Some forms will submit while others will not. In particular, I have observed that forms that are created with drupal_get_form() before a form with $form_state['rebuild'] = TRUE do submit as expected. Only forms that are created after the $form_state['rebuild'] = TRUE form do not submit. This inconsistent behavior with unexpected side-effects is what led me to categorize this issue as a "bug report" and not simply a "support request".

Also, if I could refrain from setting $form_state['rebuild'] to TRUE until that form is actually submitted I would, but using $form_state['storage'] always forces $form_state['rebuild'] to TRUE. The alternative is to use some other storage when building a form (session or hidden inputs), but that is inconvenient and leads to developers doing things in a variety of ways that could be done in a standard way that is obvious to all.

Attached is a module called badsubmit that demonstrates the inconsistent, side-effect inducing behavior. I do hope it's an easy fix for you guys that can be rolled into the next release of D6 :)

CommentFileSizeAuthor
badsubmit.zip874 bytesJeremy Cook

Comments

sinasquax’s picture

Same issue, have you found a solution ?

sinasquax’s picture

Corrected by comment line 212 of form.inc :


//$_POST = array();

I have tested with some multiple steps forms and i don't see any bug with this line commented

georgir’s picture

the bug was reported again here http://drupal.org/node/386678
not knowing for sure if clearing the $_POST array may be needed in some cases, i have posted a somewhat safer fix there.

sinasquax’s picture

Thank you, i will use your fix

mdupont’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)