Comments

Ahmed_Samir created an issue. See original summary.

ahmed_samir’s picture

Issue summary: View changes
StatusFileSize
new769 bytes
tclark62’s picture

This patch fixed the errors I was getting:

Notice: Undefined index: value in webform2pdf_send2pdf() (line 15 of ..... webformpdf.mail.inc)
Warning: array_merge(): Argument #2 is not an array in webform2pdf_send2pdf() (line 20 of ..... webformpdf.mail.inc)
Warning: array_map(): Argument #2 should be an array in webform2pdf_send2pdf() (line 21 of ..... webformpdf.mail.inc)

Now the email which is checked no longer receives a PDF.
However, now I receive two new notices:

Notice: Undefined offset: 3 in webform2pdf_send2pdf() (line 13 of  ..... webformpdf.mail.inc)
Notice: Undefined offset: 3 in webform2pdf_send2pdf() (line 19 of  ..... webformpdf.mail.inc)

For some reason it's attempting to pass through more variables than the array has. I added a dummy email address to not be sent an email, so that it has enough not to through this notice, but this should be incorporated in the patch. (I would, but my php is very weak so I can't detect exactly where it's going wrong.)

tclark62’s picture

Status: Patch (to be ported) » Needs review
roderik de langen’s picture

This is not working when 2 emails are sent out to the same addres.
Any ideas how this could be done?

tclark62’s picture

Status: Needs review » Needs work

There are still issues with the completeness of this patch. Should have set this status previously.

eric115’s picture

Version: 7.x-4.0 » 7.x-4.x-dev
Status: Needs work » Needs review
StatusFileSize
new2.37 KB

Did some more work on the patch, this fixes this issue for me. Please review :)

eric115’s picture

StatusFileSize
new2.37 KB
new790 bytes

Whoops, the array_map can be moved outside of the loop now.

tclark62’s picture

I went to test this patch, but for some reason the files needed to patch for both this issue and another issue related to webform2pdf aren't present. In both 4.0 and 4.x-dev of Webform, I'm missing webform2pdf.theme.inc and webform2pdf.mail.inc. Do you know of any reason for this?

eric115’s picture

@tclark62, I checked my patch again, but it looks like it's patching the right file and the files definitely exist in the 4.x branch (http://cgit.drupalcode.org/webform2pdf/tree/includes) - are you sure you have an unchanged version of webform2pdf? Could you try downloading a fresh copy of the module and trying to apply the patch again, just in case? Also, make sure you are applying this patch to the webform2pdf module, not the webform module.

DependencyHell’s picture

StatusFileSize
new903 bytes

webform 7.x-4.14
webform2pdf 7.x-4.0

Patch #8 for this issue is not working with an email field allowing multiple values
Patch #11 is not working with empty (optionals) email fields (Current version is showing warnings)

yanyong’s picture

I run into the same issues. Here is my fix.

IowaBoy’s picture

I just used yanyong's patch #12 and it worked for me

sethfisher’s picture

This patch works for me