Problem/Motivation
#956186: Allow AJAX to use GET requests caused a(nother) regression with bulk actions on ajax-enabled views.
Steps to reproduce
- Install Drupal 11.x with standard profile
- Enable ajax on the /admin/content view
- Create one article node
- Visit /admin/content and apply a filter (e.g. Type = Article)
- Delete the article through bulk operations
This causes POST request with extra state, which somehow just reloads the page without any CSS, no message and nothing happens:

Proposed resolution
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3372678-6.patch | 5.67 KB | lauriii |
| #8 | interdiff.txt | 2.05 KB | lauriii |
| #8 | 3372678-8.patch | 4.66 KB | lauriii |
| #6 | 3372678-6-test-only.patch | 3.94 KB | lauriii |
| #5 | 3372678-5.patch | 1.05 KB | lauriii |
Comments
Comment #2
berdirComment #3
berdirComment #4
lauriiiIt looks like this is caused by
\Drupal\Core\Form\FormSubmitter::redirectFormwhich is using current request and$request->query->all()to generate URL to redirect to. I'm not sure what would be the best way to address the bug here. We could define a redirect URL for this form, but I think we should try to find a more generic solution 🤔Comment #5
lauriiiMaybe something like this?
Comment #6
lauriiiWorked on some tests for this and realized that we'll need to do something about
\Drupal\Core\Routing\RedirectDestinationtoo. This is starting to be in quite a few places so I'm wondering if we should try to get rid of the query params from the request in the request stack.Comment #7
lauriiiComment #8
lauriiiAnother potential solution 🤔
Comment #10
berdirWorks fine for me. Having to handle this all over the place isn't nice, but we have better and better test coverage of this stuff, so hopefully we can refactor it into something better eventually.
Comment #13
catch#3348789: Compress ajax_page_state doesn't remove this from the query params yet but it could, and the extra test coverage will definitely help that issue to not break even more things.
Committed/pushed to 11.x and cherry-picked to 10.1.x, thanks!