repro steps:
1. enable poll module
2. go to node/add/poll
3. click "More choices"
4. click "Save"
5. fill "Question" with "something"
6. click "Save"
bug: system/ahah (empty page) is displayed
go to any page and a php notice will be displayed:
Notice: Undefined index: #ahah in form_ahah_callback() (line 1813 of includes/form.inc).
I just wanted to check if issue #350102: Submit of a form that has been loaded with ajax posts to the ajax callback URL is fixed in Drupal 7.. it isn't..
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | current_path-instead-of-request_uri.patch | 451 bytes | Bevan |
| #7 | drupal.system_ajax_poll_484838.patch | 428 bytes | rfay |
| #6 | ajax_system_ajax_bug.tgz | 1.05 KB | rfay |
| #6 | Screenshot-AJAX Bug: Submit to system-ajax | d7git.l - Mozilla Firefox.png | 118.87 KB | rfay |
Comments
Comment #2
pasquallechanges after #544418: Integrate CTools AJAX framework with Drupal to extend (and replace) existing ahah framework
same repro steps
bug: system/ajax (empty page with json data) is displayed
Notice: Undefined index: #ajax in ajax_form_callback() (line 212 of includes\ajax.inc).
Comment #3
rfayI'll revisit this in my AJAX documentation shortly.
Comment #4
catchMoving around.
Comment #5
rfayLooking at this again, I didn't get it recreated exactly as described, but did get it with this sequence:
repro steps:
1. enable poll module
2. go to node/add/poll
3. click "More choices"
4. click "Save"
5. fill "Question" with "something"
6. Fill in each of the 2 options
6. click "Save"
bug: system/ajax json data is displayed
Comment #6
rfayMoving this back to the form system after some investigation.
A test module is attached that demonstrates this quite simply (See screenshot).
This path will demonstrate the issue
1. Use an AJAX-enabled element in a form.
2. Press submit (non-AJAX-enabled) and fail validation.
3. Fix whatever was wrong and press submit.
4. Form rebuilds with action = system/ajax, which is all wrong.
5. Press submit again. It submits to system/ajax, getting you a screenful of JSON.
Here's what I think is happening.
In the case where everything is done via AJAX, this comes out OK. But where part of the form (like an individual select) is AJAX and the submit button is not, you get this catastrophic failure.
Comment #7
rfayThis tiny patch fixes the poll bug, and it fixes the bug demonstrated by the example module posted above. And I think it will pass the bot (we'll see).
It just removes the assumption that system_element_info should set #action to request_uri().
Why was that assumption there?
I'm not sure this is the correct fix, because I don't understand the original author's intent.
Comment #8
chx commented#671184: AJAX form can submit inappropriately to system/ajax after failed validation
Comment #9
rfayComment #10
ytsurkthis patch also solved a similiar issue for me.
when a form is loaded via quicktabs ajax - in ?some circumstances, buttons do make an ajax post, which should submit the form normally, resulting in JSON in the browser ..
Comment #11
Bevan commentedTesting an alternate solution.
Comment #13
Bevan commented