Hi,
I have been having emails recently after form submission with attached blank PDFs.
I tracked this issue down to the themeing function on line 583
$attachment->filecontent = theme('webform2pdf_mail2pdf', $webform2pdf_send2pdf['nid'], $webform2pdf_send2pdf['sid']);
I replaced it with
$attachment->filecontent = theme('webform2pdf_mail2pdf', array('nid' => $nid, 'sid' => $sid);
I created variables $nid and $sid above because it was easier for me
$nid = $message['params']['submission']->nid;
$sid = $message['params']['submission']->sid;
I'm not sure if this is relevant to anyone else but this was causing errors on my site until I changed the themeing function to use an array.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | webform2pdf-email_pdfs-2240967-8.patch | 1.03 KB | lunazoid |
Comments
Comment #1
smoysauce commentedI am having the same issue, but cannot get your fix to work. I get a parse error.Scratch that...I got the errors to go away but still blank PDF's only when e-mailed after submission, but also just realized I'm on the 7.x-4.x-dev version as I am using Webforms 4...sorry about that
Comment #2
roragok commentedI don't know what your issue is exactly but the error I was getting was that the line
was not passing in proper values.
$webform2pdf_send2pdf['nid']and
$webform2pdf_send2pdf['sid']were always sending 1 and 1 respectively to the themeing function.
but the proper values were still in the
$message['params']['submission']I don't know if that is helpful to you.
Comment #3
smoysauce commentedThanks I appreciate that. I attempted to make the changes, but no luck. Where did you add your $nid and $sid lines? In the new version, the 583 line is at line 200 or so. I will just have to keep looking and trying things out. Thanks again!
Comment #4
roragok commentedAre you still in this function?
function webform2pdf_mail_alter(&$message)Sorry I haven't looked at the dev version.
My code looks like this for the area where I was having issues
Comment #5
smoysauce commentedYou rock! That fixed my problem. Thank you very much!!!
Comment #6
ecvandenberg commented#4 also works for me with Webform 7.x-4.0-rc4. Thanx!
Comment #7
akkovanettinger commented#4 solution worked for me too. using version 7.x-3.x
Shouldnt this be patched?
Comment #8
lunazoid commentedWas having the same issue with version 7.x-3.2. Thanks to solution posted by @Roragok in #4, it works! I'm submitting a patch which should also work in the dev version (actually created using the dev version, but the code is the same.) According to #6, the same changes should work in the 4.x branch, but I imagine the patch won't apply directly.
Comment #9
mr.york commentedThank you! Commited.