When I create a Webform and set Confirmation Type as Inline and enable "Limit users to one submission per webform/source entity" option, I gen the next issue:
I submit the form and see the confirmation message with Back Button. When I click the button, I have to see the previous submission with filled data. I see submission information but all the fields are empty.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 3089167-9.patch | 1 KB | jrockowitz |
| #8 | 3089167-8.patch | 1.04 KB | jrockowitz |
| #6 | issue-3089167-4.patch | 2.63 KB | lobodakyrylo |
| #3 | 3089167-3.patch | 1.69 KB | jrockowitz |
| #3 | webform.webform.issue_3089167.yml | 4.56 KB | jrockowitz |
Comments
Comment #2
lobodakyrylo commentedThe problem is Back Button emulates the Reset button so I see reset submission. I tried to rewrite a piece of code to avoid this behavior and it works for me.
Comment #3
jrockowitz commentedAttached webform replicate the issue and the attached patches fixes the reset button but not the back button.
Comment #4
jrockowitz commentedThe back buttons still does not work with Ajax.
Comment #5
virajrajankar commentedComment #6
lobodakyrylo commentedThis works for me
Comment #7
paulocsI don't know if I'm reproducing the issue correctly but I follow this steps:
1) Create a new webform
2) Add the fields, set "Limit users to one submission per webform/source entity" and set Confirmation Type as Inline.
3) Go to the form page, add values to the fields and submit it.
4) Click on the Back button.
I see the fields with the data that I submitted.
Cheers, Paulo.
Comment #8
jrockowitz commentedI still see the issue with the back button and Ajax for the patch from #6.
The issue is the confirmation page's hidden back button is no longer being rendered when the back button's Ajax request is coming back to the server because the last submission is being automatically loaded (\Drupal\webform\WebformSubmissionForm::setEntity). The confirmation page is no longer being displayed with the hidden back button.
The ajax request breaks because the triggering (back button) element is removed from the rendered form.
I do not see any easy solutions. The attached patch disables the ajax behavior for the back button for webforms with unique limits.
Comment #9
jrockowitz commentedComment #11
jrockowitz commentedUnderstanding the complexity of the issue the patch from #9 is the best solution to prevent the backlink from not working.
For webforms, with unique limits using a confirmation message is the best approach and works fine with Ajax.