Adept to the new empty results empty facet behaviour of facets

Created on 24 November 2023, 10 months ago

Problem/Motivation

Facets changed how they handle empty facets. jsonapi_search_api_facets has some code which also tackles this problem in AddSearchMetaEventSubscriber:79

This fails now with the latest dev release of facets if the search has no results.

"TypeError: reset(): Argument #1 ($array) must be of type array, bool given in /app/cms/web/modules/contrib/jsonapi_search_api/modules/jsonapi_search_api_facets/src/EventSubscriber/AddSearchMetaEventSubscriber.php:79

https://git.drupalcode.org/project/facets/-/commit/a903026303868cd0a901c...

Steps to reproduce

Proposed resolution

Only reset the array if it is an array.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇨🇭Switzerland yobottehg Basel

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024