Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hey Webformers!
Short but important: In my case, the webform submission is triggered too early when I make use of pagebreaks -- after pressing 'next page', webform behaves as if I had presse 'submit'. Strange error. Thanks for fixing it.
Comments
Comment #1
Blooniverse CreditAttribution: Blooniverse commented... as described on #1084464: Webform submission fails -- when pagebreaks & option 'automatically save as draft between pages' are on , my multi-step webforms still trigger the submission process too early, even after ticking off the checkbox 'Automatically save draft between pages'!
Comment #2
Blooniverse CreditAttribution: Blooniverse commented... the bug can surely be found in
webform_client_form_pages($form, &$form_state)
(from line 2039 on). Although I am not a webform maintainer, I cannot resist to experiment briefly -- will inform you about the outcome in ~1h!Comment #3
Blooniverse CreditAttribution: Blooniverse commentedThis is clearly a bug of the module 'Webform Validation' (http://drupal.org/project/webform_validation). Changing the issue settings accordingly.
I tested this procedure on a Drupal7 test system with barely any contributed/optional modules. As soon as I switch on 'Webform Validation', I get the error as described above.
Thanks for fixing!!!
Comment #4
jtwalters CreditAttribution: jtwalters commentedIsn't it desired behavior to validate the page at each form submit?
Comment #5
Blooniverse CreditAttribution: Blooniverse commentedHey @jtwalters! Thanks for asking this.
Well, yes, naturally after every multi-step procedure/page 'Webform Validation' should check. It is absolutely correct if the validation module checks after pressing the 'next' button -- but this action should not lead to a premature submission! Which it does on my system (barebone test system & full ~80+contrib modules edition/system).
Comment #6
svendecabooterHmm the webform_validation module basically only adds a validate function to webforms, and sets form_set_error() when a validation rule was not met, so I can't see how it would trigger a (premature or other) form submission, as that part is totally handled by Webform / Form API.
Could you elaborate some more on what you are doing, what the desired outcome is, and what the desired outcome is, so I can have a better view on the issue?
Thanks
Comment #7
Blooniverse CreditAttribution: Blooniverse commentedHey @svendecabooter! Thanks for your question.
Comment#2
If there is a bug link to the Webform module, then it must be found somewhere here (below), I guess:
Comment #8
svendecabooterCan anyone else reproduce this?
I have tested this module with tons of different webforms, on different sites, and different branches (D6/D7 - Webform 2.x / 3.x), and never was my webform submitted (i.e. stored in the database) before the whole form was completed without validation errors.
There was a problem with the counting of pages in the webform (see #833500: Doesn't work for fields inside a fieldset), so if you do a git clone of the latest code, that might solve your issue.
However I can't see why that would be the case, since webform_validation doesn't trigger form submissions at all, but who knows, I might be wrong :)
Sven
Comment #9
Blooniverse CreditAttribution: Blooniverse commented... thanks, @svendecabooter. I am going to check out your advice coming week, when I have more time.
Comment #10
Blooniverse CreditAttribution: Blooniverse commented... still haven't found time yet. Sorry!
Comment #11
branana CreditAttribution: branana commentedI can confirm I'm getting this error as well. I'm going to debug webform_client_form_pages() a bit. I don't have webform validations
Comment #12
branana CreditAttribution: branana commentedI found that neither submit handlers webform_client_form_pages() nor webform_client_form_submit() due to my "component tree" index in form_state being too large and whatever webform is doing to the database in between each page break is trying to write too much to the database. I was able to get around this problem by increasing the max_allowed_packet variable to 32M, up from 1M in my.cnf.
Comment #13
dazrour CreditAttribution: dazrour commentedSo has something changed in Webform to increase the amount of data being wrote to the database. I had a number of working multipage forms then for some reason they now dont work. I am unable to increase the max_allowed_packets, has anyone found another work around or fix?
Comment #14
svendecabooterWebform validation doesn't add anything extra to the database when you try to submit a form that has validation rules.
It merely checks which rules are applicable, and uses form_set_error() to mark specific form component(s) as invalid, based on the rules you defined. No database interactions there (except getting the rules from the database, but those are just retrieval queries).
Can you elaborate on what's not working with the forms? Note that there are some options in the Webform module itself regarding multipage forms (e.g. saving drafts each step of the form, etc...) that might cause problems in your setup.
Comment #15
jansenCreative CreditAttribution: jansenCreative commentedI am a front end user for Drupal and I have created a webform with 3 pagebreaks and multiple selections. I am encountering the issue listed above. I am fairly certain my issue is how my form is set up or organized, I just can't find documentation/education on advanced webforms without using PHP.
I am trying to find any documentation or tutorials on:
Comment #16
Liam MorlandI think the original issue is the same as #1781490: Conditional fields can cause form to submit unexpectedly. The issue is clicking on "Next Page" causing a form submit because conditionals hide all following form components. I am closing this as a duplicate because the discussion there is more focused on what the desired behavior should be. I don't think this has anything to do with Webform Validation; I have it turned off and I still see this issue.