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.
This happens when I use Table format. unformatted works - that is it creates a document.
I've attached the error message.
Comment | File | Size | Author |
---|---|---|---|
#6 | views_pdf.template.1148570.patch | 436 bytes | berliner |
views_pdf_error_msg.jpg | 190.25 KB | dogboy72 |
Comments
Comment #1
hunziker CreditAttribution: hunziker commentedIt seems that you have a exclude a field in the view. Remove this field. Something is wrong with it.
Comment #2
prjcarr CreditAttribution: prjcarr commentedHi Hunziker,
I am having the same problem. I am getting the above error if I have any fields excluded. Once I untick "exclude" the pdf renders, but unfortunatley it then shows all fields which is not suitable for my application. I cant totally remove the fields either because other rendered fields (rewritten output) depend on them.
Is there a fix for this?
Thanks
Comment #3
hunziker CreditAttribution: hunziker commentedThe problem is that, we need to render the excluded fields, because we need the output for the token system.
I need to think about it how we can solve this correct. Hot fix is to remove the line 509 in views_pdf_template.php.
Comment #4
hunziker CreditAttribution: hunziker commentedLatest commit contains a bug fix for this.
Comment #5
essbee CreditAttribution: essbee commentedIs that fix being ported to 7.x?
Comment #6
berliner CreditAttribution: berliner commentedReopening because the bug is still there.
Tested with dev and 1.0.
The error is triggered here:
$template is actually the template name without the extension, that's why the preg_match call does return FALSE. There is no views field with the template name though. A work around that works for me is to add a check to see if $template is a key in $view->field, see the attached patch.
Comment #7
jvieille CreditAttribution: jvieille commented#6 works for me
Thanks for the patch
Comment #8
Simon Georges CreditAttribution: Simon Georges commentedCommitted, thanks!
Comment #9
Simon Georges CreditAttribution: Simon Georges commentedDoesn't seem to be needed in 7.x.