Problem/Motivation

Update site to Drupal 10.1
Try to edit Facet
Error: Call to a member function getType() on null in Drupal\facets\Plugin\facets\processor\BooleanItemProcessor->supportsFacet() (line 107 of /var/www/html/web/modules/contrib/facets/src/Plugin/facets/processor/BooleanItemProcessor.php).

This also prevents editing a view that uses that facet.
Drupal\facets\Exception\InvalidQueryTypeException: No available query types were found for facet Color in Drupal\facets\Plugin\facets\facet_source\SearchApiDisplay->getQueryTypesForFacet() (line 312 of /var/www/html/web/modules/contrib/facets/src/Plugin/facets/facet_source/SearchApiDisplay.php).

At first I thought it was all facets, but it is just this one.

Unfortunately I had to delete the broken facet to move on so it will be difficult to test.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork facets-3374554

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

nicxvan created an issue. See original summary.

sakthi_dev made their first commit to this issue’s fork.

giorgio79’s picture

Getting this error on a content that has a taxonomy term, and I added a facet for the term name...

himanshu_jhaloya’s picture

Assigned: Unassigned » himanshu_jhaloya
himanshu_jhaloya’s picture

Assigned: himanshu_jhaloya » Unassigned
Status: Active » Needs review

Created the MR. For the issue. Please Review

sassafrass’s picture

I applied the patch in MR!177 and am still getting the same error.

pcambra’s picture

Tbh I'm not sure if this is a bug, I think at least the exception should display the actual error rather than something generic, I'm adding a MR that instead of checking for null checks for the interface, and that moves the error from "Error: Call to a member function getType() on null" to the actual field being missing from the facet.

I think that's the root cause of this issue, when you delete a field from the search api index than the view uses, everything kinda breaks, which Idk how we can prevent.

The solution for showing the form would be to do a try/catch on every processor's "supportsFacet" method, but not sure if that's worth doing.

pcambra’s picture

Version: 2.0.6 » 2.0.x-dev
Priority: Critical » Normal
smustgrave’s picture

Status: Needs review » Needs work

Think we need to determine

1. Are there any duplicates around this issue
2. What caused this, want to make sure we aren't masking a larger issue.