The errors are along the lines of:

    Notice: Undefined index: 6 in webform_submission_send_mail() (line 253 of includes/webform.submissions.inc).
    Warning: Invalid argument supplied for foreach() in webform_submission_send_mail() (line 253 of includes/webform.submissions.inc).

In this instance component 6 is a checkbox labelled "Email me a copy of this message" with the value "Yes" if the user ticks it.

In the email settings this component is chosen as the "To address", and then the value "Yes" is mapped to the submission value token for a separate email_address email component, which the user is required to have filled in ([submission:values:email_address]).

This works nicely, except that when the user doesn't tick the box, no value exists for that value, and the mapping code generates a PHP notice.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jweowu’s picture

Status: Active » Needs review
FileSize
689 bytes
quicksketch’s picture

Status: Needs review » Fixed

Thanks, great catch. I think this had primarily been tested with select lists rather than checkboxes, and since a single checkbox isn't going to put anything in POST, I can see how this would happen. Committed. Thanks!

Status: Fixed » Closed (fixed)

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

fenstrat’s picture

Version: 7.x-4.x-dev » 8.x-4.x-dev
Assigned: Unassigned » fenstrat
Status: Closed (fixed) » Patch (to be ported)

Needs porting to 8.x-4.x.

fenstrat’s picture

Version: 8.x-4.x-dev » 7.x-4.x-dev
Assigned: fenstrat » Unassigned
Status: Patch (to be ported) » Fixed

Committed and pushed 0f59a09 to 8.x-4.x. Thanks!

  • Commit 728321f on 8.x-4.x authored by jweowu, committed by fenstrat:
    Issue #2137699 by jweowu: Email mapping does not account for missing...

Status: Fixed » Closed (fixed)

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