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.

CommentFileSizeAuthor
#8 2983977-8.patch1.91 KBStryKaizer
#2 2983977.patch1.51 KBborisson_
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Nick_vh created an issue. See original summary.

borisson_’s picture

Status: Active » Needs review
FileSize
1.51 KB

Tried to follow @StryKaizer's instructions, this should be it.

borisson_’s picture

Nick_vh’s picture

Status: Needs review » Needs work

Clear filters also clears the query, which is not a wanted behavior. Need more work :)

borisson_’s picture

Title: Summary clear facets is not working when you have pretty facets enabled » Summary clear facets is not working when you have pretty paths enabled
borisson_’s picture

Did we decide that we wanted to have configuration for that query parameter?

StryKaizer’s picture

Status: Needs work » Needs review
FileSize
1.91 KB

Patch 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)

mvantuch’s picture

The reset is displayed in this case but is pointing to the view without the contextual filter.

StryKaizer’s picture

@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?

mvantuch’s picture

Hi @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

StryKaizer’s picture

ic. 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?

mvantuch’s picture

Frankly 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.

borisson_’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Ok, this means that we should add test-coverage for the combination of facets + exposed filters with the Exposed filters first before committing this?

jwwj’s picture

The 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 :)

StryKaizer’s picture

Status: Needs work » Reviewed & tested by the community

Moving to rtbc, since we dont have time to write tests :'( and this fixes an existing issue

  • borisson_ committed eb5aa6c on 8.x-1.x authored by StryKaizer
    Issue #2983977 by borisson_, StryKaizer, mvantuch, Nick_vh: Summary...
borisson_’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs tests

Ok, let's get this in.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.