Closed (fixed)
Project:
Facets
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 May 2022 at 11:37 UTC
Updated:
31 May 2022 at 11:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
upchuk commentedHere is a fix and a test that proves. I wrote a brand new test, maybe you can move it or advise for where it would be a better place. I am not seeing any test coverage for custom facet sources.
Hope it's green elsewhere.
Comment #5
upchuk commentedAh lol, made a small mistake. Here we go.
Comment #6
mkalkbrennerThanks for the patch. But I wonder if this is the correct solution.
Neither the HierarchyProcessor nor the Hierarchy Plugin should be limited to Search API. So the problem might be the something else:
The question is, why isn't it set?
Comment #7
mkalkbrennerPreviously the hierarchy was hardcoded to be taxonomy. The update hook above should set the plugin instead for all existing facets. So the question is under which circumstances the exception is thrown?
Comment #8
upchuk commentedI wouldn't know, I didn't work on that. But the issue is on the form itself not necessarily the entity, as shown in the test and I describe above.
So if hierarchy is supposed to work with other facet sources as well, fine, but at the moment, the form doesn't and the submit handler of the form assumes that it does. So that needs to be fixed or otherwise facet that use non search api sources wont be saveable.
Comment #9
mkalkbrennerThe taxonomy plugin is currently limited to the Search API backend. But as we now allow 3rd party hierarchy plugins we must not limit this functionality to Search API anymore.
Here's a quick and dirty patch. It would be better to introduce a feature to let plugins declare their backend compatibilty. But there's no list of well-known backends yet.
Comment #10
upchuk commentedNo issue that I see here. But I am not knowledgeable about the hierarchy stuff of facets.
Comment #11
mkalkbrennerComment #13
mkalkbrenner