The following tutorial (which is great, btw! Thanks!) http://drupal.org/node/101707 explains how to create a multipage form with FAPI2.
Unfortunately, the 'Wizard' type form do not work well with Node type forms, even for the node types defined in a node type module: the node is supposed to be submitted only at the last step (or at any step that the programmer chooses), but currently Drupal core will automatically submit the node (and save it to the DB) as soon as the first step is processed. The workflow explained in the tutorial for the 'Wizard' type form do not work with Node forms.
There is a quite heavy handed work-around, by using the solution provided in multipage_form_example.module, but there should be an easier way: Drupal core should check whether we are using a multipage node form and only submit the node form when the node-type module programmer says it can do so.
See the comments at the bottom of the tutorial page.
I am not sure if this is a feature request or if this should be considered a bug. So I set as 'task' for now: change the category as you wish.
Comments
Comment #1
oscnet commented+1
Comment #2
kirie commentedYes I agree, Drupal should support easy creation of multistep node forms.
+1
Comment #3
pwolanin commentedHave you tried using a button that does not submit for intermediate steps (e.g. like poll module uses the preview button to add more poll choices)?
I realize this is not ideal, but might at least get things working.
Comment #4
z.stolar commentedThis is what I did - I turned the submit button into a 'button' button, until the last step. It works fine.
But still, I agree that multistepping is still not THAT easy. A big improvement would be to make $form_values accessible through hook_form_alter.
This way, one won't have to create a special crafted node type, just for the sake of multistepping.
Comment #5
Anonymous (not verified) commentedz.stolar,
Could you give a code example of what you did?
FnL
Comment #6
chx commentedFAPI3 fixes this.