Hi Jacob.
It looks like Entity Print module stopped recognizing the webform-submission.html.twig template. I had this template configured with custom markup, which was working with previous versions of the Webform module.
After some digging, I saw this old webform issue that may be related? https://www.drupal.org/project/webform/issues/2883402
```The entityprint.module module is looking a 'full' view mode, which was not supported by webform submissions.
The attached patch defaults any missing view mode to 'html' and outputs the submissions data with the submission information.```
I tested a node template with Entity Print and it worked with the custom markup.
Any insight?
Thank you.
Jim
Webform 8.x-5.1
Entity Print 8.x-2.1
Drupal core 8.6.10
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | 3041602-16.patch | 14.1 KB | jrockowitz |
| #9 | 3041602-9.patch | 5.18 KB | jrockowitz |
| #4 | Screen Shot 2019-03-19 at 4.49.00 PM.png | 181.83 KB | jrockowitz |
Comments
Comment #2
jim22 commentedComment #3
jrockowitz commentedHere the entity print URL format.
/print/pdf/webform_submission/SID
/print/pdf/webform_submission/SID/debug (Shows the HTML converted to PDF)
Comment #4
jrockowitz commentedUsing /print/pdf/webform_submission/SID/debug with Twig debugging enabled the template suggestions are now
Comment #5
jrockowitz commentedHere is the source of this change and when webform submission template is missing.
#3017333: Hide submission information from the edit submission page, css only working for admin not anonymous users
We might need to fix this for just the entity print module (aka full display mode)
I think we can use hook_entity_view_alter() to fix this regression.
Comment #6
jrockowitz commentedThe below hooks fixes the problem.
Still, I think there might be a better approach.
Comment #7
jim22 commentedThanks, Jacob. Much appreciated!
Comment #8
jrockowitz commentedThe below webform-submission.html.twig template contains the information, navigation, and the submission (aka data). The bigger issue is the submission (aka data) no longer has a template around it. The template should be provided by the WebformSubmissionViewBuilder and should be called
webform-submission-data.html.twig. I think we can make this improvement without causing any regressions.The
webform-submission-data.html.twigwould be used by the entity_print.module and provide a consistent way to alter the submission data without the information or navigation.Comment #9
jrockowitz commentedComment #16
jrockowitz commentedComment #17
jrockowitz commentedComment #19
jrockowitz commentedComment #21
maloojackson commentedHello, please if i want to render fields data with {{ submission }}, it is {{ submission.first_name }}? Please help. Thanks
Comment #22
jrockowitz commented