Webform entity print attachment token doesn't work

Created on 23 May 2024, 11 months 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 11 months 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 11 months 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.

Production build 0.71.5 2024