Closed (duplicate)
Project:
Drupal core
Version:
7.x-dev
Component:
forms system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
8 Jun 2009 at 05:26 UTC
Updated:
27 May 2014 at 04:44 UTC
Jump to comment: Most recent, Most recent file
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