Adding a facet summary with only "Show a summary of how many results were found" selected results in warnings

Created on 3 May 2023, over 1 year ago

Problem/Motivation

If you add a facet summary facet and only want the result count processor, you will get errors on render.

Warning: Trying to access array offset on value of type null in Drupal\facets_summary\FacetsSummaryManager\DefaultFacetsSummaryManager->build() (line 124 of modules/contrib/facets/modules/facets_summary/src/FacetsSummaryManager/DefaultFacetsSummaryManager.php).

Steps to reproduce

  1. Add a facet summary.
  2. Deselect all items under "Facets Summary settings" except for "Show a summary of how many results were found".
  3. Save.
  4. Render the facet summary block.

Proposed resolution

Add a check for whether that facet was configured to be displayed or not.

Patch attached.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Facet summary

Created by

πŸ‡ΊπŸ‡ΈUnited States SiliconValet

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

Comments & Activities

Production build 0.71.5 2024