Consider including a processor which always includes active filters in the list of facet results

Created on 8 June 2018, over 6 years ago
Updated 12 August 2024, 3 months ago

Problem/Motivation

I have a scenario where users can land on a URL which filters a view using facets. The user didn't organically click through to this URL via a selection of facets. In some cases, there are no results for the view. What ends up happening is, since the active set of filters is not included in the list of results from each given facet, the user is unable to de-select the criteria being filtered.

Proposed resolution

I think it makes sense to provide a processor which always includes the active filters in the list of results for a particular facet.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia Sam152

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update over 1 year ago
    424 pass, 2 fail
  • πŸ‡¬πŸ‡§United Kingdom mjmorley

    In Drupal 10 the method getMasterRequest on the RequestStack is gone and we should just use getMainRequest. I have updated patch #9 to reflect this, as patch #10 failed some tests.

    This new patch should be compatible with D10.

  • πŸ‡«πŸ‡·France aymen.essid

    Update for patch #:
    For Drupal 10, "getMasterRequest" method should be replaced by "getMainRequest".

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.6
    last update 12 months ago
    Patch Failed to Apply
  • πŸ‡ΊπŸ‡ΈUnited States robpowell Boston

    I wasn't able to get the patch to apply but I did add it as a custom facet processor manually. One item to note, this is a post_query processor and because of that it may not play nice with other build processors. For example, on my site we have hierarchical facets and after adding always show active to the hierarchical facet renders the active item outside of their expected hierarchy.

    Expected Result for active item grandchild

    • Facet one
      • Parent
        • child
          • [X] grandchild

    Actual Result

    • Facet one
      • [x] grandchild
      • Parent
        • child

    Is there a way for the active item to be in its expected hierarchy?

  • πŸ‡ΊπŸ‡ΈUnited States edwardsay

    Patch #12 applies and works great! That's exactly what we needed.

Production build 0.71.5 2024