Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The supportsFacet function that was added in "Disable boolean processor on non-boolean facets" https://www.drupal.org/project/facets/issues/2913244 is too restrictive. I have a facet that is created on a boolean search field on an entity-reference field on a content type. The supportsFacet check is returning false because it is using $definition->getDataType()
, which in this case is returning entity reference, even though my facet is on a boolean search field. Looking for a way to have the check look at the search field type instead.
Comment | File | Size | Author |
---|---|---|---|
#7 | supportsFacet-too-restrictive-3010328-6.patch | 828 bytes | helioha |
#5 | supportsFacet-too-restrictive-3010328-5.patch | 1.07 KB | Mikechr |
#2 | supportsFacet-too-restrictive-3010328-2.patch | 961 bytes | nrackleff |
boolean-search-field.png | 14.38 KB | nrackleff |
Comments
Comment #2
nrackleff CreditAttribution: nrackleff at ThinkShout commentedI'm adding a patch here that is absolutely NOT intended to be a real solution to this problem. This patch just has the supportsFacet function return true without doing any checks. This is just to stop it from hiding the form at all so I can use it on a site where I need it.
Comment #3
TrevorBradley CreditAttribution: TrevorBradley commentedI'm hitting something similar. My aggregate boolean field somehow has a type definition of "string". Good to know I'm not alone!
I'm going to resolve this by making my own BooleanItemProcessor plugin, extending the original but having supportsFacet return TRUE.
Comment #4
borisson_Let's see if this still applies, because if it does I don't see any harm in applying this. I'd prefer a little bit more visual clutter over things not working.
Comment #5
Mikechr CreditAttribution: Mikechr as a volunteer and commentedInstead of showing the Boolean processor on all facets
return TRUE
I believe it would be better to show the processor only if the field is indexed as a boolean field.Comment #7
helioha CreditAttribution: helioha as a volunteer commentedCreating a patch based on #5. I kept the old code intact since I'm not sure if removing it could break things.
Comment #8
borisson_This looks great, we should probably also write a test for this. But I'm not too unhappy with this going in as-is.
Comment #10
mkalkbrennerCommitted, thanks for your help!