Views Filter group "Or" operator not working

Created on 17 March 2019, over 5 years ago
Updated 29 March 2024, 8 months ago

Hello,

The "Or" operator in filter groups act as an "And" operator.

Example:

I would like to display content tagged with a term in the "Composition" vocabulary OR with a term in the "Support" Vocabulary.

But the result act as an "AND" condition, the two filters are applied in the same time:

- If i choose only one term in the "Composition" filter i get 5 results
- If i choose only one term in the "Support" filter i get 2 results

So if choose theses terms in the same time the view should give me 5 + 2 results
But i only get 3 nodes tagged with each term.

Any help ?

Thanks

🐛 Bug report
Status

Active

Version

11.0 🔥

Component
Views UI 

Last updated 9 days ago

Created by

🇧🇪Belgium jbfelix

Live updates comments and jobs are added and updated live.
  • DrupalWTF

    Worse Than Failure. Approximates the unpleasant remark made by Drupal developers when they first encounter a particular (mis)feature.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇮🇳India sundarraj.p

    Thanks #2 works for me as well (this is in the case of workbench)

  • 🇳🇿New Zealand petednz

    Observed the same problem 10.0.9 with a Content based View using the following Filters
    Is published AND ( content field OR taxonomy term)

    and of those only the 'content field' has the Reduce duplicates option, and if i do set that then i start seeing items that were not included but am now seeing duplicates (as some content has both the filtered field and the filtered term). I already have it set to Distinct.

    I wondered if getting rid of 'is published' might help, ie the filter is now a simple one level OR - but same problem, i either miss out on lots of results, or i get them but get them twice.

    So for me the workaround in #2 does not suffice.

  • I have this issue as well. It should be noted that the issue can be seen in the UI as well. Even when using the workaround and having "Reduce duplicates" checked for the OR-able filters, the UI still shows "AND":

    The workaround in #2 helped get the query working. However, the UI still shows an incorrect result.

  • 🇪🇸Spain penyaskito Seville 💃, Spain 🇪🇸, UTC+2 🇪🇺

    This is completely counter intuitive.

    Something like (A AND B) or (A AND C) adds a left join on A table with "! A", which obviously returns an empty set as you end with A AND !A.

Production build 0.71.5 2024