Need help porting to 5.x
| Project: | Add and Reference |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Hello,
I am porting this module and Form Restore to 5.x, and I'm almost done, but I'm running into a small problem. When one of the 'Add a new _____' buttons is clicked, it causes the form on the current page to go through submission and form validation, which it will fail if required values have not been entered, and then drupal_set_message() will be called saying that required fields are missing. On the next page, then (the form to create the referenced node type) these messages will appear.
The problem appears to be that the form's pre_render function is where the redirect happens, and it is being called after the form has already been validated. Any idea on how to change this?
Thanks,
Ben

#1
Hi Ben!
My apologies to all for support breaking. I've been disappointed with nodereference's parent-child hierarchies building capabilities and can't find well-supported replacement for Form restore module. I've tried to get talking with edkwh about his Autosave (draft saving module) without any response. Glad to see Your interest! Waiting for file attachments...
#2
/bookmark
I'm interested in this too.
#3
Howdy tema and majorxp,
Sorry for taking so long to respond. Here is a patch for add_n_reference. Note that this is not finished, and still suffers from the problem I described above. You will also need a patch for form_restore, which I will attach momentarily.
#4
...and here is the patch for form_restore. Note once again that this is just a snapshot of what I'm working on, not production ready by any means.
I'll be away from the Internet for about a week or so, but would love to hear from you guys if you manage to figure out a way around the issue described above. I will look into the autosave module once I get back.
Cheers,
Ben
#5
Excellent progress. Where are you at now, and do you need any help?
#6
I'd love to hear about any more problems or solutions on this patch. We could really use this module in our development.