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.

Comments

lobodacyril created an issue. See original summary.

lobodakyrylo’s picture

Status: Active » Needs work
StatusFileSize
new2.39 KB

The 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.

jrockowitz’s picture

Status: Needs work » Needs review
StatusFileSize
new4.56 KB
new1.69 KB

Attached webform replicate the issue and the attached patches fixes the reset button but not the back button.

jrockowitz’s picture

Status: Needs review » Needs work

The back buttons still does not work with Ajax.

virajrajankar’s picture

Assigned: Unassigned » virajrajankar
Issue tags: +DIACWApril2020
lobodakyrylo’s picture

StatusFileSize
new2.63 KB

This works for me

paulocs’s picture

I 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.

jrockowitz’s picture

Status: Needs work » Needs review
StatusFileSize
new1.04 KB

I 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.

jrockowitz’s picture

StatusFileSize
new1 KB

  • jrockowitz authored afc8af3 on 8.x-5.x
    Issue #3089167 by jrockowitz, lobodacyril: Issue when Confirmation Type...
jrockowitz’s picture

Status: Needs review » Fixed

Understanding 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.

  • jrockowitz authored afc8af3 on 6.x
    Issue #3089167 by jrockowitz, lobodacyril: Issue when Confirmation Type...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.