When using webforms in conjunction with webform2PDF and E-mail setting 'Attach PDF as an attachement to the e-mails sent to the form recipients' enabled. I always get this notice :

Notice: Undefined index: exclude_empty in webform_submission_render() (regel 641 van /var/www/sites/all/modules/contrib/webform/includes/webform.submissions.inc).

For more details, see the related issue

Comments

pbosmans’s picture

StatusFileSize
new656 bytes

Patch created for this notice.

sumitmadan’s picture

if ($email && (array_key_exists('exclude_empty',$email) && $email['exclude_empty']))

can be changed to :

if ($email && isset($email['exclude_empty']))

Also change status to "Needs Review" after submitting a patch. :)

danchadwick’s picture

This should be fixed in webform2pdf, which is creating the incomplete email. Or is there a reason it can't?

We avoid adding tests for data that must be there.

danchadwick’s picture

Project: Webform » Webform2PDF
Version: 7.x-4.9 » 7.x-4.x-dev

Moving to the webform2pdf issue queue for further development.

br0ken’s picture

But why we can't reinsured and add isset()? This simple check prevent for future notices.

Better to check array indexes than not to check.

br0ken’s picture

Assigned: Unassigned » br0ken
Status: Active » Needs review
StatusFileSize
new519 bytes
br0ken’s picture

I've also created a patch to Webform (https://www.drupal.org/node/2601546).

br0ken’s picture

What we gonna do with this?

ladybug_3777’s picture

I'm curious at where this issue stands. I am experiencing this issue when using the webform2pdf module as well.I've following related issue links that have gone from that module over the webform, back to webform2pdf, and once again back to webform.

To be honest I'm not sure what the recommended patch to use is anymore. Can someone set me straight? Thanks!

ladybug_3777’s picture

I took the path of least resistance here and applied this patch (it seemed the simplest and least intrusive) : webform-exclude_empty-2499749-6.patch

I can confirm that the error message is gone. I have some more testing to do, but so far so good.

br0ken’s picture

Status: Needs review » Reviewed & tested by the community

@ladybug_3777, this patch is correct.

ladybug_3777’s picture

Thank you Br0kEN!

michel.settembrino’s picture

I had the same issue and patch "webform-exclude_empty-2499749-6.patch" solves it.

Thanks!

Regards,
Michel.

br0ken’s picture

Assigned: br0ken » Unassigned

  • BR0kEN committed 001288c on 7.x-4.x
    Issue #2499749 by BR0kEN, pbosmans: Notice: Undefined index:...
br0ken’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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