0
  • Drupal version : 8.2.0
  • Module "Better exposed filter" version : 8.x-3.0-alpha1

In short :

I created a view with an exposed filter. When I use the operator "is all of" from my exposed filter, all works. My exposed filter shows some tags in a select/option html list. I downloaded and installed the module "Better exposed filter" for display my exposed filter in checkbox instead the select/option html list. If I configure my exposed filter for it display checkboxs, then the view displays no result.

In detail :

I created 3 simples contents of type 'articles' :

  • Recipe one (tags 'ingredients' : salt, sugar )
  • Recipe two (tags 'ingredients' : super, pepper )
  • Recipe three (tags 'ingredients' : pepper, salt )

I created a very simple view :

enter image description here

enter image description here

When I do a search, I get two of my articles if I select the tag "sugar" with the exposed operator "is all off" : (look the Query, only one "INNER JOIN")

enter image description here

Tags exposed filter is an html select/option list. I want to change this style by a list of checkboxs. So, I configure the filter style with the "better exposed filter" module :

enter image description here

When I do that, my view works when I search with the filter exposed operator "is one of". But when I use the filter exposed operator "is all off", no result displayed !

enter image description here

In the new query, I noticed there are two "INNER JOIN". The second uses an id = 0, the error must be here.

My questions are :

  • Do I forget something in my configuration ?
  • Is a bug in the module "better exposed filter" ?
  • What should I do to operate the operand "is one off" when I display it in list of checkboxs ?
2

1 Answer 1

0
+50

No, It's a bug with the Better Exposed Filter module. From the looks of it, something is causing a '0' value to be added as a part of the WHERE clause.

You can see this in action by toggling the Allow multiple selections filter option; when the option is off you can select a non - Any - value to filter the view as expected; when the option is on any selection appends '0' value to the filter.

From looking at your linked issues, they look potentially related but not the same. You should look through the BEF module issue queue and if it's not posted yet, post it there to be reviewed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.