Hello
I'm using contact_forms in a project, where I need the to make som dynamic changes to the contact form via AHAH.
I have my own module to do that, but contact_forms is causing major problems.
Because this module asumes that the path used to render the form is 'contact' I can not make any AHAH calls (which are definitely not in the 'contact' path) it causes a redirect.
I'm attaching 2 patches, one for the 1.12 and one for the 1.x-dev
What is the logic behind it:
We want to alter the form only when there is a second parameter [arg(1)] which corresponds to the category of the message.
Once we are in, we save the category in $form_state['storage']['contactform_redirect'] so subsequent calls know we have a category, regardless of the path used to make the call
For every other call (those made via AHAH) we do not check the path but we check whether we have a category set in $form_state['storage']
So basically we alter the form if it is beng called from /contact/* or if we have $form_state['storage']['contactform_redirect'].
I haven't tested the patch for the dev version, but the one for 1.12 works.
I urge you to commit this, since AHAH is being used more and more everyday and believe me, it spent hours trying to find the problem.
Cheers
Comment | File | Size | Author |
---|---|---|---|
#1 | contact_forms-6.x-1.x-dev_1101534-1.patch | 1.36 KB | jm.federico |
#1 | contact_forms-6.x-1.12_1101534-1.patch | 2.45 KB | jm.federico |
Comments
Comment #1
jm.federico CreditAttribution: jm.federico commentedComment #2
jm.federico CreditAttribution: jm.federico commentedComment #3
jm.federico CreditAttribution: jm.federico commentedI just read the title and realized it makes no sense!
Changing!
Comment #4
behindthepage CreditAttribution: behindthepage commentedHi,
I haven't had time to look at this closely but have a few questions.
1. Will your patch allow any one to add an AHAH solutions with my module or is it just for your AHAH?
2. Does it change any of the functionality of my module?
Regards
Geoff
Comment #5
jm.federico CreditAttribution: jm.federico commentedHello
It changes no functionality (according to my tests) and it is generic enough so that any AHAH call should work.
Plz note that I haven't tested the dev version. Patch for dev was made solely from my experience with 1.12, but should work.
Cheers
Comment #6
Summit CreditAttribution: Summit commentedHi, How will this work on D7 version please?
greetings, Martijn
Comment #7
behindthepage CreditAttribution: behindthepage commented