+++ multiform.module 2010-03-05 03:17:58.541025196 -0800
@@ -0,0 +1,115 @@
+ * For example, if the first form is called as
+ * drupal_get_form($form_id1, $arg1, $arg2); and
+ * the second as drupal_get_form($form_id2, $arg3, $arg4) call
+ * multiform_get_form(array($form_id1, $arg1, $arg2), array($form_id2, $arg3, $arg4)).
Logically, two forms that are merged into one should be closely related to each other. Therefore, "Save" means save to both, "Delete" means delete to both, etc.
So, merge buttons into the top-level $form by their labels?
Because otherwise the drupal_build_form calls would redirect.
Gotcha! :) However, multiform should try to retain the redirection target for the parent form... i.e. anything other than $_GET['q'] or FALSE in $form_state['redirect'] should be considered as redirection target. To KISS, take the first.
I know this patch is old, but it removes the ability to use the same form more than once since it's keyed by form_id rather than form_id and array key.
Comments
Comment #1
chx commentedComment #2
sunMissing CVS Id.
Arguments don't map?
Missing @code and @endcode tags here.
I don't understand why no_redirect is enabled here. Multiform doesn't seem to intercept or handle form submission/redirects (yet)?
That's a tough challenge.
Would merging the buttons be an idea?
Logically, two forms that are merged into one should be closely related to each other. Therefore, "Save" means save to both, "Delete" means delete to both, etc.
So, merge buttons into the top-level $form by their labels?
Move into tests/multiform_test.module
Powered by Dreditor.
Comment #3
chx commentedI don't understand why no_redirect is enabled here. Multiform doesn't seem to intercept or handle form submission/redirects (yet)?
Because otherwise the drupal_build_form calls would redirect. Major oopsie.
Would merging the buttons be an idea?
Then we would need to copy around -- there would still be only one button pressed in $_POST. But I presume yeah that's doable.
Comment #4
sunGotcha! :) However, multiform should try to retain the redirection target for the parent form... i.e. anything other than $_GET['q'] or FALSE in $form_state['redirect'] should be considered as redirection target. To KISS, take the first.
Comment #5
chx commentedA whole new module...
Comment #6
sunMainly cuts down to documentation and markup tweaks:
s/button/actions/
+ #type 'container', or resp. 'actions', after #482816: Make a consistent wrapper around submit buttons landed
hah. Most likely only understood by a Form API maintainer :)
wow. Took a minute to understand that this means to works on the first processed form only ;)
Powered by Dreditor.
Comment #7
BenK commentedSubscribing and plan to test....
Comment #8
dave reidI know this patch is old, but it removes the ability to use the same form more than once since it's keyed by form_id rather than form_id and array key.
Comment #9
joseph.olstad