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.
Configuration is available at https://github.com/nickveenhof/drupal8-umami-search
Clear facets is most likely not taking the path into account and is expecting a parameter.
Comment | File | Size | Author |
---|---|---|---|
#8 | 2983977-8.patch | 1.91 KB | StryKaizer |
Comments
Comment #2
borisson_Tried to follow @StryKaizer's instructions, this should be it.
Comment #4
borisson_Comment #5
Nick_vhClear filters also clears the query, which is not a wanted behavior. Need more work :)
Comment #6
borisson_Comment #7
borisson_Did we decide that we wanted to have configuration for that query parameter?
Comment #8
StryKaizerPatch keeps all get params excl. query string url processor defined ones.
Also works with pretty paths this way (by checking $facet->getActiveItems() instead of the query)
Comment #9
mvantuch CreditAttribution: mvantuch commentedThe reset is displayed in this case but is pointing to the view without the contextual filter.
Comment #10
StryKaizer@mvantuch Did you use #8 to check this?
This patch should only remove active facets from the query, unless you use the same filtername for your contextual filters.
Or are you using something else than a views page as facet source?
Comment #11
mvantuch CreditAttribution: mvantuch commentedHi @StryKaizer,
Yep, using the #8 and just plain and simple views with a contextual filter. Is this combination working for you?
I had to remove this build and revert back to the query url processor due to another bunch of issues so can't test it directly, but can try it again if need be.
Generally, the reset link simply points to the view base path /articles instead of the one with the contextual filter /articles/category - I've encountered this in another issue where the logic for getting the base path was the same as here - related to contextual filters with facets pretty path itself. https://www.drupal.org/project/facets_pretty_paths/issues/2952005
Comment #12
StryKaizeric. Is there a reason why you are using both contextual filters and facets? Is there anything facets can not do, which requires you to also use contextual filters?
Comment #13
mvantuch CreditAttribution: mvantuch commentedFrankly it had not really ocurred to me that I could use facets for that too.
While I could probably do it, the URL would require change from /articles/[category] to /articles/category/[category] - which is a problem in relation to the requirements for the website. Aim was to separate the functionality which can be "faceted" on the page and which is simply a filter - for which we've jused the contextual filters.
Comment #14
borisson_Ok, this means that we should add test-coverage for the combination of facets + exposed filters with the Exposed filters first before committing this?
Comment #15
jwwj CreditAttribution: jwwj as a volunteer commentedThe patch in #8 fixed an issue I had with the reset facets link not showing up at all in the summary. Not sure if the root cause was the same, but at least the reset link shows up after applying the patch :)
Comment #16
StryKaizerMoving to rtbc, since we dont have time to write tests :'( and this fixes an existing issue
Comment #18
borisson_Ok, let's get this in.