Webform entity print attachment token doesn't work

Created on 23 May 2024, over 1 year ago

Entity Print webform_submission attachment pdf token doesn't work

Steps to reproduce

I'm using the Webform Remote Handlers module to send the webform submission to the REST API in a custom format and I need to include the generated PDF as a token.

I added the Attachment PDF field to my form build, the file is generated normally, but when I try to send it as a token, it doesn't work.

[webform_submission:values] includes the link
but when i try to do [webform_submission:values:attachment_field_id], I receive it as [webform_submission:values:attachment_field_id], and not the url or content.
Ideally, I need the file ID to get content and send it in base64 format.

Thanks!

🐛 Bug report
Status

Active

Version

6.2

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mmyau
  • Status changed to Postponed: needs info over 1 year ago
  • I don’t completely understand this bug report or what “it doesn’t work” means on a technical level. That said is this something to do with this default configuration ?

  • If that setting doesn’t lead to a solution, you need to update the issue summary. The steps to reproduce must be complete proceeding from installing Webform module.

  • Sorry, I updated the request, I hope it's more clear now

  • Is there a way to trigger the bug with only Webform? Could you please also talk about what I wrote in comment #3? What is the evidence pointing to Webform itself as having this bug as opposed to the other modules?

    I don’t understand steps 6 and 7, and I don’t understand the actual behavior vs the expected behavior.

  • There is a way to trigger the bug with only Webform - generated file is not present in WebformSubmissionInterface $webform_submission

  • It would be ideal if you respond to all my questions, and also if you update the steps to reproduce to be as short and as simple as possible.

  • I updated the description.
    I tried two different Rest handlers, both built into the Webfrom module, and Webform Remote Handlers, and the Attachment PDF value is missing in both cases

  • Status changed to Active over 1 year ago
  • Ok. Let’s see if this is documented well enough for contributors.

  • 🇬🇧United Kingdom robcarr Perthshire, Scotland

    I'm seeing exactly this problem with an 'Attached PDF' field (requiring Entity Print module ) in a Webform - requiring Webform Entity Print (PDF) and Webform Entity Print (PDF) Attachment modules to be enabled. I'm not extending Webform with the Webform Remote Handlers module, so my instance is slightly simpler.

    The token (for example) [webform_submission:values:pdf_version] is rendered as [webform_submission:values:pdf_version] in an email generated by a Webform Email handler, not the generated link to the PDF file (which would be expected behaviour).

    I've been able to generate a link to the PDF using [site:base-url]/print/pdf/webform_submission/[webform_submission:sid]?view_mode=html&token=[webform_submission:token] but this doesn't generate the PDF file with the correct filename.

  • 🇵🇹Portugal introfini

    The issue is that the Attachment PDF element isn't available through the [webform_submission:values:*] token. Since I need to send the PDF to a remote endpoint, I created a custom token that encodes the Attachment PDF element in base64.

  • Status changed to Closed: won't fix 14 days ago
  • 🇺🇸United States jrockowitz Brooklyn, NY

    This issue should be resolved through custom code or a dedicated contrib module that extends the webform_attachment.module to include a 'webform_attachment_entity_print' element that could be used to attach the entity print PDF to any email.

  • Now that this issue is closed, please review the contribution record.

    As a contributor, attribute any organization helped you, or if you volunteered your own time.

    Maintainers, please credit people who helped resolve this issue.

Production build 0.71.5 2024