Need help porting to 5.x

benwei - August 31, 2007 - 18:19
Project:Add and Reference
Version:4.7.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

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

tema - September 3, 2007 - 05:01

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

majorxp - September 10, 2007 - 06:50

/bookmark

I'm interested in this too.

#3

benwei - September 14, 2007 - 03:04

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.

AttachmentSize
add_n_reference_5x.patch 4.24 KB

#4

benwei - September 14, 2007 - 03:06

...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

AttachmentSize
form_restore_5x.patch 22.05 KB

#5

discursives - November 23, 2007 - 07:17

Excellent progress. Where are you at now, and do you need any help?

#6

markDrupal - January 23, 2008 - 03:17

I'd love to hear about any more problems or solutions on this patch. We could really use this module in our development.

 
 

Drupal is a registered trademark of Dries Buytaert.