In a webform with an invalid e-mail address for sending the submission, choosing the option to resend the e-mail is intended to add " (empty)" after the missing or otherwise invalid address. Instead, it uses a hold-over from the D6 FAPI, appending to ['#value"] in the form, rather than the D7 ['#markup']. This throws a notice in the log and of course doesn't work.

In webform.submissions.inc, function webform_submission_resend:

...
    $valid_email = !empty($email_addresses[0]) && valid_email_address($email_addresses[0]);
...
    $form['emails'][$eid]['email'] = array(
      '#markup' => implode('<br />', $email_addresses),
    );
    if (!$valid_email) {
      $form['emails'][$eid]['email']['#value'] .= ' (' . t('empty') . ')';    // <-- should be '#markup'
    }

'#value' should of course be '#markup'.

This should be applied to the 7.x-4.x branch, too, I presume. 3.x branch patch to follow.

CommentFileSizeAuthor
#1 resend_form_markup-1803702-1.patch686 bytesDanChadwick
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DanChadwick’s picture

Status: Active » Needs review
FileSize
686 bytes

Patch making above trivial fix.

quicksketch’s picture

Status: Needs review » Fixed

Thanks! Great little fix. Sorry this took so long to review. Committed to D7 branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.