Facet title does not disappear if there are no options

Created on 1 February 2025, 4 months ago

Problem/Motivation

Facet title does not disappear if there are no options.

"Hide facet with 1 result" is selected bu i see the facet title.

Thank you

🐛 Bug report
Status

Active

Version

3.0

Component

User interface

Created by

🇮🇹Italy trickfun

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

Comments & Activities

  • Issue created by @trickfun
  • 🇺🇸United States fizcs3 Omaha, Nebraska; USA

    I'm confused by this setting too.

    To clarify, this is the on the settings of a Facets Enabled Filter:

    I presumed it would hide the entire facet if there was only 1 result (i.e. 1 "option"), but instead it displays the facet, suppresses the 1 result and instead says "No results found" in the facet:

    Ideally, the facet would be hidden completely if there was 0 or 1 results ("options" in the facet).
    This seems to be the setting to do it, cannot find another. Unless we're misunderstanding and the above is expected behavior?

  • 🇮🇳India jaydev bhatt Pune, Maharashtra

    i'm working on this.

  • 🇮🇳India jaydev bhatt Pune, Maharashtra

    i tried to regenerate this issue on Drupal core 11.1.1 while having the only one result to select on the search page in the tag facet and "Hide facet with 1 result" enabled it hide the entire facet and only shows the title of the facets.
    i have tried this wil two options Dropdown option and List with checkboxes options.

    moving this to NR for further verification.

  • Status changed to Needs review 17 days ago
  • First commit to issue fork.
  • @matthiasm11 opened merge request.
  • 🇧🇪Belgium matthiasm11

    A facets processor can alter the results, for example if the "Minimum count" is configured in the facet. In some cases there will be no results left. At that point, the processing should stop and the form for this facet should not be shown, since it will only contain a title with no options.

  • 🇧🇪Belgium matthiasm11

    Attached a static patch of the MR.

  • 🇮🇹Italy trickfun

    Patch #8 works fine.
    Thank you

Production build 0.71.5 2024