Closed (outdated)
Project:
Flag
Version:
8.x-4.x-dev
Component:
Views integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Feb 2017 at 16:54 UTC
Updated:
7 Feb 2025 at 08:00 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
acrollet commentedpatch attached - this patch attempts to get the parent path from the referrer if the redirect path is 'views/ajax'. It only replaces the destination if the referrer path resolves to an internal URL.
Comment #3
joachim commentedThanks for taking the time to figure this out!
We shouldn't hardcode Views. Partly because we don't depend on Views, but mostly because there may be other similar situations where a flag link is loaded over AJAX.
What is it about this situation that we can generalize? For instance, can get look at the current route object and detect that it's AJAXy, and use that as the condition here instead?
BTW, this patch will clash with #2732065: Flag links redirect to the system path rather than the actual path the user was on.
Comment #4
acrollet commentedthanks for reviewing! Fair enough, can't say I really know what's generalizable in terms of detecting AJAXy-ness, but how about this approach?
Comment #5
joachim commented> can't say I really know what's generalizable in terms of detecting AJAXy-ness,
What I was wondering is whether the actual Route object tells you whether it returns HTML or AJAX.
Comment #7
acrollet commentedHere's a Route object, no smoking guns that I see:
If we could get the Response, we could theoretically see if it's an instance of AjaxResponse and be in business, but I haven't been able to dig up a way to get the current response.
Comment #8
csedax90 commented#4 works for me
Comment #9
csedax90 commentedComment #10
joachim commented> If we could get the Response, we could theoretically see if it's an instance of AjaxResponse and be in business
Indeed. Though does that exist yet at this point?
Does Drupal::request() tell us anything?
Comment #11
kerasai commentedI believe this is a duplicate of #2846111: AJAX link not working when used in views, which has a patch but appears to not be merged yet due to a lack of test coverage.
Comment #12
ivnish7 years without any activity. I think we can close it as outdated. Please reopen if needed.