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.
If you add a taxonomy filter, there's an "is all of" operator that's especially useful when exposing the filter and allowing multiple selections. The user can narrow down the result set by filtering one additional term at a time.
This operator doesn't seem to exist for select lists, though, where it would offer the same benefit.
Comment | File | Size | Author |
---|---|---|---|
#4 | views_selectfilter.png | 29.71 KB | halefx |
#5 | 1494884.patch | 639 bytes | dawehner |
#10 | 1494884.patch | 639 bytes | dawehner |
Comments
Comment #1
halefxComment #2
Buntstich CreditAttribution: Buntstich commentedIn Drupal 6 are possible, but not in Drupal 7!?
Comment #3
dawehnerkeep calm ...
So you assigned the issue to yourself, so let's see whether you can find a patch for that.
Comment #4
halefxAdding a screenshot (I intended to do this a long time ago).
Comment #5
dawehnerThis is JUST an experimental patch, please don't blame me if it does not work, but sure feedback would be cool.
Comment #6
Buntstich CreditAttribution: Buntstich commentedI tested the patch with Views 7.x-3.3 and Better Exposed Filters 7.x-3.0-beta1. As master for Viewfield 7.x-2.x-dev and as a page with filters in the block. In addition, several filters were combined. So far everything works very well.
Comment #7
damiankloip CreditAttribution: damiankloip commentedTestbot?
Comment #8
tim.plunkettWrong version for the bot.
Comment #9
damiankloip CreditAttribution: damiankloip commentedah ha. How did I not spot that! :)
Comment #10
dawehnerReupload the patch for the bot ...
Comment #11
damiankloip CreditAttribution: damiankloip commentedI have just tested, seems to work fine.
Comment #12
dawehnerThanks! Committed to both 7.x-3.x and 8.x-3.x
Comment #14
John Pitcairn CreditAttribution: John Pitcairn commentedThis change breaks filter OR grouping. The join for optional field values changes from LEFT JOIN to INNER JOIN, making the field value required (effectively ANDing the filter group). See #1766338: Incorrect filter group OR behavior, LEFT JOIN changed to INNER JOIN.
Comment #15
John Pitcairn CreditAttribution: John Pitcairn commentedI'm re-opening this issue and unassigning @buntstich. See #1766338: Incorrect filter group OR behavior, LEFT JOIN changed to INNER JOIN.
@dawehner, there is a patch in that issue that simply reverts the commit from this one, but applying that will result in a missing operator error for anyone using the new operator.
I guess the best option is to fix this issue so the new operator works without breaking filter OR groups, but doing so is probably beyond my ability/time at present.
Comment #16
Stephen OllmanI'm unable to get the desired result using 'is all of' as this patch is meant to fix in D7.
I have a taxonomy group,
Banana
Apple
Orange
I have a node that is assigned both Banana and Orange.
In my view I have an exposed filter set against the taxonomy terms using 'is all of' as I want users to be able to filter down to an exact match.
So if I expose filter Banana only I get the node.
If I expose filter Orange only I get the node.
However if I expose filter Banana AND Orange I get nothing.
Any thoughts as to why?
I can obviously use 'is one of' that that gives a very loose criteria and any node with Banana or Orange will be displayed, but that's not the required result.
Comment #17
nhck CreditAttribution: nhck commented