When a user's personal contact form is requested, contact_user_page() no longer passes $recipient when it calls drupal_get_form('contact_mail_user', $recipient), resulting in a NULL recipient.

<?php
$output = drupal_get_form('contact_mail_user', $account);
...
function contact_mail_user($recipient) {
?>

The reason is that the $recipient array is now being passes as the second argument. This fixes it:

<?php
$output = drupal_get_form('contact_mail_user', $account);
...
function contact_mail_user($x, $recipient) {
?>

...but of course is by no means correct. My hunch is that this is a result of the FormAPI change and that $x should probably be $form_state. Please advise.

CommentFileSizeAuthor
#1 contact-fapi.patch653 bytesDavid Lesieur
no_recipient.jpg20.97 KBmatt@antinomia

Comments

David Lesieur’s picture

Title: contact_user_page() no longer passes $recipient to contact_mail_user() » FAPI fix: missing form_state in contact module
Status: Active » Needs review
StatusFileSize
new653 bytes
pwolanin’s picture

Status: Needs review » Reviewed & tested by the community

This fix is also, of course, contained in this patch: http://drupal.org/node/58224

however, this is trivial and can be committed ASAP.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks. :)

Anonymous’s picture

Status: Fixed » Closed (fixed)