Hi everyone,

i'm stuck on a bug with the latest webform dev.

I have a single page webform with preview page. Whenever i click the back button on the preview page, the form submit and move forward to the confirmation page.

I think this maybe related to the lines 2922 to 2924

        // The "Previous" button over-shoots backwards by one page. The "Next"
        // button doesn't advance at all, so in both cases, we increment by one.
        $form_state['storage']['page_num']++;

does anyone else have this bug ?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Title: Webform preview back button » Webform preview "back" button submits form

Hi @tempo22, thanks for opening this issue. I thought I saw another user reporting this same problem, but I can't find it at first pass through the issue queue.

I've confirmed this problem on a stock install of Webform, but the problem only appears when there is only one page in the form. On multi-page forms, the preview back button works correctly. I've got a lot of things going on currently, but I'll try to address this when I get the chance. Anyone else interested in attempting a patch, please do so.

tempo22’s picture

Status: Active » Needs review
FileSize
1.54 KB

This fixed it for me. However the code seem a bit messy and maybe worth to check why the preview page back button overshot.

SpadXIII’s picture

Here's a different kind of patch that is a bit smaller.

It adds a check if a previous pagebreak has been found.

quicksketch’s picture

Thanks guys! Between the two patches, @SpadXIII's would be preferable for me from a maintenance stand-point. @tempo22, could you test it out and see if it works in the situations you're trying?

tempo22’s picture

Work for me :)

SpadXIII’s picture

My patch probably needs a bit of testing still; a co-worker had found a little issue but I haven't had time to check it myself

SpadXIII’s picture

The issue that I mentioned is not really related to this; if the last component is a page-break, you can't continue anymore. You're stuck in the page before the 'empty page'. I think this is related to the code in the .module around line 2896; the foreach-loop exits after the found page-break, but doesn't move to the next page. I guess it's better to make a new issue of this?

quicksketch’s picture

if the last component is a page-break, you can't continue anymore.

Looks like DanChadwick made an issue for this exact issue at #2220679: Cannot submit if the webform ends in a page break. You guys work together? :)

quicksketch’s picture

Status: Needs review » Fixed

This patch works great. Committed to the 4.x branch. Thanks guys!

  • Commit 09b8973 on 7.x-4.x by quicksketch:
    Issue #2204515 by tempo22 and SpadXIII: Webform preview back button...

Status: Fixed » Closed (fixed)

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

fenstrat’s picture

Version: 7.x-4.x-dev » 8.x-4.x-dev
Assigned: Unassigned » fenstrat
Status: Closed (fixed) » Patch (to be ported)

Needs porting to 8.x-4.x.

fenstrat’s picture

Version: 8.x-4.x-dev » 7.x-4.x-dev
Assigned: fenstrat » Unassigned
Status: Patch (to be ported) » Fixed

Committed and pushed 09b8973 to 8.x-4.x. Thanks!

  • Commit 8b0619f on 8.x-4.x by fenstrat:
    Issue #2204515 by tempo22, SpadXIII: Webform preview "back" button...

Status: Fixed » Closed (fixed)

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

bushrang3r’s picture

Version: 7.x-4.x-dev » 7.x-4.1
Priority: Normal » Major
Status: Closed (fixed) » Needs review

Hi everyone,

Sorry to open this again but I'm still having this same or very similar issue.

I have a multi-page form and when I click the back button to preview the previous page, the previous page appears but the form is submitted. If I go through each page of the form, fill in the information and click back on each page, it gets submitted every time so the one form has 2, 3, 4 submissions even before getting to the submit button on the last page.

I thought maybe I should install the dev version but the 7.x.4.1 was updated more recently than the dev.

bushrang3r’s picture

Version: 7.x-4.1 » 7.x-4.x-dev
Priority: Major » Normal
Status: Needs review » Closed (fixed)

Sorry folks. I was using the module incorrectly.

I tried to return this issue back to it's previous status.