- Merge request !2Account for ajax-enabled views when fetching the current path → (Closed) created by kimberleycgm
- 🇬🇧United Kingdom joekers UK
The query is also affected by this issue - when the saved search is created, the query doesn't always have the conditions applied when using a view that has AJAX enabled.
As per the comment on [3315790-4] the active query doesn't have the filter applied from the AJAX call.
- last update
over 1 year ago 47 pass - last update
about 1 year ago 52 pass - Status changed to Needs review
about 1 year ago 2:26pm 2 February 2024 - last update
about 1 year ago 52 pass, 1 fail - 🇦🇹Austria drunken monkey Vienna, Austria
Thanks a lot!
I managed to write a test for this, which confirms both the problem and the solution. However, it unfortunately also demonstrates that the problem is even more severe than previously thought: not only is the URL saved for the search incorrect, but also the underlying search query is missing the facet filter. This means the results reported for the saved search will be wrong – and, unfortunately, the proposed patch doesn’t seem to fix this problem. It appears we’d have to construct the query object some other way in this case – though I don’t really know how, as we completely rely on the search query already executed on the current page for the whole “Save search” functionality.Anyways, still posting the patch with the failing test. I don’t think I’d commit this in the current form (after commenting out the failing test, of course), though, as it seems to me that this would actually make the situation worse: currently, users might at least notice that the search query is incorrect, when they follow the link. With the proposed patch, the link would point to the correct page, but the reported results would still be wrong. (Though, at least it will usually be more results than desired, not less, which is probably a bit less bad.)
Any input would be much appreciated.
The last submitted patch, 11: 3251247-11--ajax_facets_lost.patch, failed testing. View results →
- 🇺🇦Ukraine khiminrm
I've noticed that current solution doesn't work when we have initial value for the exposed form's param in a URL. For example we have redirected to the ajax views page from search form on a site from another page. And then we change search keyword which have been submitted by ajax. So I've improved the patch by using query params from the AJax request, but path from the referrer.
- 🇦🇹Austria drunken monkey Vienna, Austria
Created an MR (since we now use those for development) and removed some left-over debugging code I spotted.
Let’s see what the tests say, whether the improvements from #14 fix the problems. However, to me it looks like they might actually make the problem worse at least in some cases, since it’s my understanding that we do want to use the GET params from the referrer at least in some scenarios. If you’re right that we sometimes don’t want to use them, this gets even more complicated, as I’m not sure how we could determine which of them is the case in any given instance. - 🇦🇹Austria drunken monkey Vienna, Austria
Test bot seems to confirm my feeling, let’s see how early it fails without the changes in #14.
- 🇦🇹Austria drunken monkey Vienna, Austria
Seems the test fails later without the changes in #14, so keeping the MR like that.
Still far from a complete solution, though.