3.0.4 introduced an error for facets_exposed_filters in #3589162: Support special hierarchy processors as exposed filters
When you have an active search filter, which causes a facet to have no results

Error is "Call to a member function getSearchApiQuery()" for that specific facet.

Issue fork facets-3617839

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

strykaizer created an issue. See original summary.

strykaizer’s picture

Issue summary: View changes

jonsimonsen’s picture

Removed comment since it was referring to a different issue

ramil g made their first commit to this issue’s fork.

ramil g’s picture

Status: Active » Needs review

I ran the proposed fix through an AI-assisted code review and tested the resulting changes on a Drupal 10 site. The original guard prevents the fatal error, but the review suggested moving it before facet initialization, checking explicitly for a NULL query, and limiting it to facets that have not already been processed.
I updated the MR accordingly and added a unit test covering an exposed-filter block without a Views query. I also manually verified that selecting a site-wide facet now filters the results without triggering the getSearchApiQuery() error.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community
dready2011’s picture

I had the same problem and the patch fixed it for me.

joelpittet’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for testing it @dready2011 and for the initial fix @strykaizer and iteration @ramil g!

I ran the tests only which do indeed show it tests the right thing, and seen it fix my problem directly too. The merge train has left the station!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

camhoward’s picture

I ran into this issue after updating to Drupal 11.4.6 and Facets 3.0.6. After the update, the blocks in the header and footer regions, the search field, all site menus, and the tabs for editing nodes were missing from the front end of the site. The error message displayed at the bottom of the page.

I was glad to find this issue and manually applied the changes in the MR !395 diff. The site then returned to normal with all blocks and navigation restored. Search and facets are now working normally again.

Thank you!

joelpittet’s picture

I am torn on making another release until we sort out #3618467: Facets 3.0.4 introduces BC break in WidgetPluginBase constructor but glad this helped you too @camhoward.

Status: Fixed » Closed (fixed)

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