Closed (fixed)
Project:
Webform
Version:
8.x-5.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Apr 2019 at 20:47 UTC
Updated:
17 Apr 2019 at 12:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
alberto56 commentedComment #3
alberto56 commentedI have also experienced this on an unrelated site, so I'll move to major, as this might cause strife for users who are informed of submissions via email and do not necessarily have access to the backend. (In my case hundreds of emails go out daily to different users and there is no workaround for them to have access to the data as they don't have accounts on the site).
Meanwhile, using 5.1 (composer require 'drupal/webform:5.1') works fine.
Comment #4
jrockowitz commentedThis regression was caused by #3040616: EmailWebformHandler with tokens types extensible I am pretty sure the browser token dialog is just missing the webform/submission tokens while the email handler is still correctly replacing the tokens.
Comment #5
jrockowitz commentedI miss read the issue and this should be marked critical until we can make that token replacement is working as expected.
Comment #6
jrockowitz commentedThe attached patch fixes the browse token dialog. I can't replicate the generate email with missing token replacements.
Attached is my attempt to replicate the missing token replacement issue.
Can you please provide an example that replicates the missing token replacement issue?
Comment #7
jrockowitz commentedI did a full review of the patch from #3040616: EmailWebformHandler with tokens types extensible and I am not seeing how the token replacement could have broken. Generally, the Webform module has good test coverage for keys things like token replacements but minimal or no coverage for minor UX features like the token browse dialog.
Comment #8
alberto56 commentedThanks for looking into this @jrockowitz, I had a hard time reproducing this on a new environment and I finally found a way to consistently reproduce this and it has to do with multi-page forms:
(1) Using webform 8.x-5.1, create a multistep form which sends an email whose custom body contains: [webform_submission:values]
(2) Fill in the form manually (don't use the webform "test" mode) and confirm all values are sent in the email
(3) Update to webform 8.x-5.2, drush updb -y && drush cr
(4) Fill in the form manually (don't use the webform "test" mode) and confirm you see only the values from the first page of the form
In my tests, the webform "test" mode resulted in everything working as expected in 5.1 and 5.2, however manually entering the data resulted in it being sent only in 5.1.
The reason I was getting no data in the submissions is because in my case I the fields in the front page of my webform were not required.
The submissions not being sent might be a separate issue from the tokens not appearing.
Comment #9
alberto56 commented@jrockowitz I am attempting now to reproduce this on a new Drupal site and will report back with my findings shortly
Comment #10
jrockowitz commentedI am not able to replicate the issue described in #8 using the attached webform.
Comment #11
alberto56 commentedThanks again for your time @jrockowitz; I am not able to reproduce it after a few hours of trying: my broken webform acts fine when I duplicate it on my existing setup; and it acts fine on a new environment; I will write this off as a fluke, and will open a new ticket with more detailed steps to reproduce if it occurs again. I will thus suggest setting this back to normal and dealing only with the token selector GUI here, if that's OK with you.
Comment #12
jrockowitz commented@alberto56 How about you export the broken and duplication form and let's do 'Diff' to see what is missing or broken?
If you are uncomfortable doing a diff you can upload both webform config files here.
Comment #13
alberto56 commented@jrockowitz so both forms are in fact identical (both the yml and the exported config) which is odd. I am including it here for the sake of completeness, however it is almost certain to me now that this is unrelated to the problem addressed by this patch, and probably related to some alter hook or something, somewhere in the code. Because I had the same form on two different sites, and because the issue started occurring at the same time as the missing token from the browse token window, I assumed they were related, but, turns out they are not. So thanks again!
Also, setting your patch to 'reviewed and tested', as it works fine for me.
Comment #14
jrockowitz commentedI think we need to do a comparison of the entire webform's config and not just its elements.
Comment #15
alberto56 commented@jrockowitz, so as a last ditch effort to figure this out, I exported the entire webform config, I then deleted my database, reinstalled Drupal and set the site UUID to the same as the config, then reimported everything, and I can no longer reproduce the issue at all, even with the original webform which was causing issues. So, this should probably be marked database corruption of some type. Thanks again for your help with this, as always!
Comment #16
jrockowitz commented