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 :)
| Comment | File | Size | Author |
|---|---|---|---|
| badsubmit.zip | 874 bytes | Jeremy Cook |
Comments
Comment #1
sinasquax commentedSame issue, have you found a solution ?
Comment #2
sinasquax commentedCorrected by comment line 212 of form.inc :
I have tested with some multiple steps forms and i don't see any bug with this line commented
Comment #3
georgir commentedthe 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.
Comment #4
sinasquax commentedThank you, i will use your fix
Comment #5
mdupontAs #386678: Using/setting form_state['storage'] in one form on a page prevents any other form on page from posting ($_POST is destroyed) is more advanced and has the best fix, I'm closing this issue as a duplicate.
Comment #6
mdupont