Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#1 | resend_form_markup-1803702-1.patch | 686 bytes | DanChadwick |
Comments
Comment #1
DanChadwick CreditAttribution: DanChadwick commentedPatch making above trivial fix.
Comment #2
quicksketchThanks! Great little fix. Sorry this took so long to review. Committed to D7 branches.