Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When the page contains exposed form and additional form with AJAX enabled, then only views form will work. The most frequent case is: search page with AJAX exposed form and AJAX login form. In described case login will not be possible, because form will be broken by views.
Proposed resolution
Do not build exposed form when request contain the FormBuilderInterface::AJAX_FORM_REQUEST
property.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#13 | interdiff-2804457-10-13.txt | 2.83 KB | BR0kEN |
#13 | views-multiple_ajax_forms-2804457-13.patch | 5.25 KB | BR0kEN |
#6 | core-exposed-ajax-proccess-fix-2804457-6.patch | 1.1 KB | mitsuroseba |
#2 | core-exposed-ajax-proccess-fix-2804457-2.patch | 1.15 KB | mitsuroseba |
Comments
Comment #2
mitsuroseba CreditAttribution: mitsuroseba for FFW commentedComment #3
mitsuroseba CreditAttribution: mitsuroseba for FFW commentedComment #4
mitsuroseba CreditAttribution: mitsuroseba for FFW commentedComment #5
mitsuroseba CreditAttribution: mitsuroseba for FFW commentedComment #6
mitsuroseba CreditAttribution: mitsuroseba for FFW commentedReformat
Comment #7
BR0kENI've added a little explanation to the code and additionally fixed setters for
rerender
option.Comment #8
BR0kENComment #10
BR0kENComment #11
BR0kENComment #13
BR0kENComment #14
BR0kENComment #15
gaydamaka CreditAttribution: gaydamaka as a volunteer and at FFW commentedComment #17
BR0kENComment #18
dawehnerNice catches!
So does that mean that you cannot use
#ajax
on views forms?Comment #19
BR0kENIt means that you cannot use views exposed form together with other AJAX form on the same page. In my test case I have two forms: for search and for login. Things happens because views module thinks that every request was made for it, but it's not always true.
If you want I can record a small screencast with couple Xdebug breakpoints to show what's going on.
Comment #20
BR0kENThe problem still exists.
Comment #21
dawehner#18.2 still exists IMHO.
Sorry but be patient, just being annoyed doesn't help :)
Comment #22
BR0kEN@dawehner, I'm not annoyed :) Just trying to pay attention of others onto this ticket.
So, you are saying that if I enable AJAX in view configuration then patch will break it?
Comment #23
mitsuroseba CreditAttribution: mitsuroseba for FFW commentedAs I see now(8.2.5) we have additional check in core/lib/Drupal/Core/Form/FormBuilder.php
OLD ONE
NEW ONE
And with this check we don't try to process AJAX submit with wrong handler.
Comment #24
dawehner@mitsuroseba
This is really interesting. I ran into a similar issue recently, and I think this should really help.
Comment #26
BR0kENComment #27
mitsuroseba CreditAttribution: mitsuroseba for FFW commentedRechecked one more time and it works fine now, so close this issue.