Drupal temporary wizard form
I am creating a wizard form to order items, I have 4 content types, project | door | dooroptions | projectoptions.
This is done in 4 steps: You give tour measurements, the doors that fit are show, you pick a door, you pick the options for the door. then you can add another door, or you can save the project (with the doors).
Saving the project then requires you to log in, or register. So one project has multiple doors. Only then the nodes should be sav开发者_如何学Ced
Everything you selected and configured, should be editable before saving. When filling in the forms, there is no known user.
My question is: how would you handle this?
Any info is welcome.
@edit
I was thinking to save all the content anyhow. Putting a boolean on the most parent node which defines if the project is "stored" or not. Then when the user registers or logs in, the bit is set to true, and a user reference is created in the project node.
Every (... hours) a cron job runs and removes the nodes that have "stored" bit false, and creationdate older then ... hours.
Another way would be to save al the forms in drupacl cache, and when logged in save all the nodes. I don't know if this is possible tough
after save it by unauthorized user, I think you should save Node id in session and after log in you should read from session and do something with it and destroy session. for this I think this steps is necessary:
1- some Drupal Trigger to save Node ID before log in,
2- redirect user after log in to a page with some PHP code that read session and assign them to authorized user
3- some rules for continue
精彩评论