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.

CommentFileSizeAuthor
#4 views_selectfilter.png29.71 KBhalefx
#5 1494884.patch639 bytesdawehner
#10 1494884.patch639 bytesdawehner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

halefx’s picture

Title: Why is there no "is all of" filter for select list fields? » Why is there no "is all of" operator for select list filters?
Buntstich’s picture

Assigned: Unassigned » Buntstich
Category: support » bug
Priority: Normal » Critical

In Drupal 6 are possible, but not in Drupal 7!?

dawehner’s picture

Category: bug » feature
Priority: Critical » Normal

keep calm ...

So you assigned the issue to yourself, so let's see whether you can find a patch for that.

halefx’s picture

FileSize
29.71 KB

Adding a screenshot (I intended to do this a long time ago).

Views select field exposed filter settings.

dawehner’s picture

Status: Active » Needs review
FileSize
639 bytes

This is JUST an experimental patch, please don't blame me if it does not work, but sure feedback would be cool.

Buntstich’s picture

I 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.

damiankloip’s picture

Testbot?

tim.plunkett’s picture

Version: 7.x-3.3 » 7.x-3.x-dev

Wrong version for the bot.

damiankloip’s picture

ah ha. How did I not spot that! :)

dawehner’s picture

FileSize
639 bytes

Reupload the patch for the bot ...

damiankloip’s picture

Status: Needs review » Reviewed & tested by the community

I have just tested, seems to work fine.

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Thanks! Committed to both 7.x-3.x and 8.x-3.x

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

John Pitcairn’s picture

This 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.

John Pitcairn’s picture

Assigned: Buntstich » Unassigned
Status: Closed (fixed) » Needs work

I'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.

Stephen Ollman’s picture

I'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.

nhck’s picture

Issue summary: View changes

dmkmedina queued 10: 1494884.patch for re-testing.

The last submitted patch, 10: 1494884.patch, failed testing.