Hey, it's me, the guy who creates issues and contributes, but no one reviews. Another unheard issue by me:
#2939693: MenuLinkTree::buildItems() ignores cache metadata of disabled links
If you're a nice person, please review my patches and maybe commit them, to have a core with less problems. Thanks!
Problem
AJAX only works for POST method requests, and there might be good reasons for it.
Still people might want to have cacheable AJAX (on their own risk), without the need of yet another framework.
Modules like AJAX assets plus are being created just for one purpose in the end: Having a working, cacheable AJAX system which is capable of GET requests.
Some people who enforce GET on AJAX responses might not be aware of the fact that already loaded assets would then be ignored. As a consequence, assets would be attached multiple times on a page with AJAX GET. That's something you really don't want.
Proposed solution
Just add another check for GET query params inside AjaxResponseAttachmentsProcessor. Attaching patch for this.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 2949148-use-query-params-as-fallback.patch | 1015 bytes | mxh |
Comments
Comment #2
mxh commentedHere we go. review plzzzzzzzzz
Comment #3
mxh commentedComment #4
mxh commentedComment #5
alexpottIt would be great if this was tested.
What about using \Symfony\Component\HttpFoundation\Request::get() here?
Comment #6
mxh commentedI'll try :)
Not sure, this would be more convenient at this place, but would always include a lookup at $request->attributes and $request->query, and lastly $request->request. The last call would be the one which is mostly used for AJAX responses, i.e. using Request::get() here would mean adding mostly two unnecessary calls.
Comment #14
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #15
mxh commentedThanks for revisiting this. I close it since there is obviously no need and I guess this doesn't make much sense to be continued as we may transition to HTMX in core on the long run.