I have a situation where I have a webform which is capturing information in the form of a questionnaire. The client would like to have the end user see their submission on the next page with another form (custom at the moment) which is simply an email field with "If you would like a copy of this report please enter your email address". The end user enters their email address and a copy of the submission is sent to them.
One idea I came up with is that you have a multi page webform. On page 1 you have all the questions and on page two you have an email field and an advanced text / markup field. The webform is set to email a copy to that email field. The submitted responses could be, or so I thought, be displayed on page two in the markup element using the token [webform_submission:values:html] but this is giving me an infinite loop error:
Maximum function nesting level of '256' reached, aborting! in Drupal\Component\Plugin\Definition\PluginDefinition->id() (line 34 of core/lib/Drupal/Component/Plugin/Definition/PluginDefinition.php).
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | Screen Shot 2018-05-11 at 15.24.50.png | 38.56 KB | vaccinemedia |
| #6 | webform.webform.issue_2972242_cannot_use_the_web.yml | 6.05 KB | jrockowitz |
| #5 | webform.webform.issue_2972242 (2).yml | 2.62 KB | vaccinemedia |
| #4 | webform.webform.issue_2972242 (1).yml | 3.63 KB | jrockowitz |
| #3 | 2972242-3.patch | 1.34 KB | jrockowitz |
Comments
Comment #2
jrockowitz commentedThe attached webform replicates the issue.
Comment #3
jrockowitz commentedThe attached patch adds a proper exception for the recursive rendering of the [webform_submission:values] token.
Comment #4
jrockowitz commented@vaccinemedia The attached webform uses a computed token element to safely render the submission values
Comment #5
vaccinemedia commentedIt's not producing the crash anymore which is a step in the right direction however, the computed token output is only showing the entered value and not the actual field label AND also only showing the first webform element. I've attached an example webform for you to check out :)
Comment #6
jrockowitz commentedYou must make sure to include
'#display_on': formin your computed token.Attached is a webform based on your example. The computed token is missing styles.
Comment #7
vaccinemedia commentedI've imported the yaml attached and have run a test to submit page one and attached is what I am seeing on page 2
Comment #8
jrockowitz commentedCan you switch the bartik theme? Your theme is not styling the output.
Comment #9
jrockowitz commentedI am seeing the same issue where nothing is being rendered.
Comment #10
jrockowitz commentedThe new issue is that the 'Test' tab is breaking the Computed Token. Try manually entering the data.
Comment #11
vaccinemedia commentedI agree - setting test data manually works, it's the test data which does not work ;) although the form labels and their values are in the same divs with no classes. I'll check to see if this is the case when using the advanced text element.
Comment #12
jrockowitz commentedThis issue is that the LABEL tag is being filtered out. This is another issue that needs to be addressed in a new ticket.
Comment #13
jrockowitz commentedI ran into an issue and just committed the LABEL fix.
Here is the patch. https://cgit.drupalcode.org/webform/patch/?id=ca960c78a4c56d0b3dc7988af6...
Comment #15
jrockowitz commented@vaccinemedia This issue should be fixed in the latest dev release.
You will need to apply the below patches to fix it in the release.
Comment #17
stevendeleus commentedI'd like to reopen this issue because I have the exact same issue with the latest version of webform and Drupal 8.