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
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
Comment #3
giorgio79 commentedGetting this error on a content that has a taxonomy term, and I added a facet for the term name...
Comment #4
himanshu_jhaloya commentedComment #5
himanshu_jhaloya commentedCreated the MR. For the issue. Please Review
Comment #7
sassafrass commentedI applied the patch in MR!177 and am still getting the same error.
Comment #8
pcambraComment #9
pcambraTbh 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.
Comment #10
pcambraComment #11
smustgrave commentedThink 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.