I have a long form which I decided to spread in 4 pages. In order to do so I introduced 3 page breaks (Page break 1, Page Break 2 and page Break 3) at appropriate places. Now (with page breaks in place) when I fill the form and after reaching the last page and click submit. The submission does not occur. Instead after refresh I remain on the same final page. When I remove the page breaks and resubmit the form the submission is successful and I am redirected to Confirmation URL/page.

Everything else seems to be working as it should. Oh Ya a couple of times I saw the following in the log but this error did not show all the time I clicked submit and most the of the times the submissions failure was almost silent. The error was some thing like
Recoverable fatal error: Argument 1 passed to file_delete() must be an instance of stdClass, null given, called in .. I actually reebooted the server and cleared the cache and anyhow the error disappeared from the log. I also got this error once when submitting the form as authenticated user

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'cid' at row 1: INSERT INTO {webform_submitted_data} (nid, sid, cid, no, data) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => 48 [:db_insert_placeholder_1] => 4 [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => 0 [:db_insert_placeholder_4] => Page Break 3 ) in webform_submission_insert() (line 133 of /var/www/vhosts/ecoms.org.uk/httpdocs/sites/all/modules/webform/includes/webform.submissions.inc).

Earlier I had installed webform_validation but then disabled and uninstalled immediately The PDO error was after uninstalling webform_validation. I also added a conditional rule on a field set on page 3 but the removed it. When I finally removed page breaks the submission was successful.

Files: 
CommentFileSizeAuthor
#9 webform_save_draft_fix-d7.patch709 bytesquicksketch

Comments

One more thing. I am constantly getting following notice:

Location: http://www.ecoms.org.uk/node/48/submissions.

Notice: Trying to get property of non-object in node_page_title_pattern_alter() (line 39 of /var/www/vhosts/ecoms.org.uk/httpdocs/sites/all/modules/page_title/modules/node.page_title.inc).

Edit: The above notice occurs at different webform url locations.

@amsri#1: Please issue a separate bug report about this page_title thing!

In my case the pagebreaks don't even work -- as soon as I click on 'next page', webform reacts as if I had pressed 'submit'!

After some more digging I found that the following setting (on form settings page) is the culprit:

Automatically save as draft between pages

When I disable this settings the submissions start happening.

Title:Webform Submission fails when page breaks introduced in the formWebform submission fails -- when pagebreaks & option 'automatically save as draft between pages' are on

Good for you, @amsri.
Bad for me (despite switching off the checkbox field 'Automatically save draft between pages'):

[...] as soon as I click on 'next page', webform reacts as if I had pressed 'submit'!

However, my issue is filed separately under #1085666: Webform submission triggered too early -- when using pagebreaks .

And your issue should still be considered as bug -- despite the possible workaround [of not ticking the checkbox].

I concur. Thanks for the explanation--just today I was grappling with the very same issue.

Hey @dquark3! Thanks for confirming. One clarification: What exactly do you mean with same issue? Is it:

  • Procedure: Multi-step submission triggers too early.
  • Checkbox: Automatically save draft between pages.

Good question.

Bug = will not finish/trigger submission on last page of multipage form (rather than triggering early it just won't submit)
Bug is indeed squashed when "Checkbox: Automatically save as draft between pages" is off.

exactly the same issue here.
If you disable the save draft it works.

Status:Active» Fixed
StatusFileSize
new709 bytes

Thanks for the great reports guys.

This patch corrects the issue. Apparently in Drupal 7 everything in the $form_state array is maintained between page loads, whereas in Drupal 6 only the contents of $form_state['storage'] were maintained. This causes the $form_state['save_draft'] setting to persist between all pages, so when you get to the final page even though Webform has not set the "save_draft" value it still exists from the previous pages. This causes the final page to just save a draft over and over again, but not trigger the actual final submission.

This fix simply sets $form_state['save_draft'] to both TRUE and FALSE between every page (previously we only set it to TRUE and assumed it was NULL otherwise).

Due to the nature of this problem, this patch also fixes #1150534: Cannot submit after save draft, even though that had different symptoms. I've committed this to bother 3.x branches for consistency.

Status:Fixed» Closed (fixed)

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

Version:7.x-3.9» 7.x-3.13

Should i have opened as a new ticket or not?
With 7.x-3.13 (just upgraded from 3.11 where I spotted the problem)
On a multi page webform with 'save draft' option, when submitting a form that has been saved as a Draft on an earlier page (not tested on all pages) when I come to submit the form on the last page, none of the entered data on the last page is 'saved' ie when I 'go back to form' i see the data in the previous pages, but last page (at least) is blank.
If i remove pagebreak, making changes to the same fields, and then submitting does result in data beings saved.

Hm, @petednz#11, why use multi step (I suppose that is what you mean with 'multi page') in combination with pagebreaks at all? I don't understand the purpose.

Anyway, if there is a buggy relation, there is a buggy relation between these two things.

I called it multi page because I am inserting page breaks. I want people to also be able to save Drafts. This is a long form with 50 questions each with 3 sections. So I was aiming for 5-6 pages.
I didn't refer to 'multistep' and I don't know where this is refered to in Webform.

Under Adv Settings I have the following set
Show "Save draft" button
Automatically save as draft between pages (Automatically save partial submissions when users click the "Next" or "Previous" buttons in a multipage form.)

Can you pls clarify what you mean by multistep if it is not what I am thinking of as multipage for the above reasons - in case i have missed something in my set up. Thanks

Should i have opened as a new ticket or not?

Yes open a new ticket and describe your issue. Reference this one with [#1084464].

@petednz#13: See 'Creating multistep webforms' !