I have a view with FILTER CRITERIA
set. I have three groups, each joined by AND
s, with the criteria within each group OR
ed. The final group are two taxonomy terms, meaning I want my query to return nodes that have one term or
the other. No node will have both of the tags set.
However, when I see the SQL in the preview, the terms seem are connected by a AND
.
WHERE (((node__field_event_categories.field_event_categories_target_id = '434')) AND ((node__field_event_categories2.field_event_categories_target_id = '212'))) AND ((taxonomy_index.status = '1') AND (((DATE_FORMAT((node__field_date_range.field_date_range_value + INTERVAL -14400 SECOND), '%Y-%m-%d\T%H:%i:%s') >= DATE_FORMAT(('2018-10-22T04:00:00' + INTERVAL -14400 SECOND), '%Y-%m-%d\T%H:%i:%s'))) OR ((DATE_FORMAT((node__field_date_range.field_date_range_end_value + INTERVAL -14400 SECOND), '%Y-%m-%d\T%H:%i:%s') >= DATE_FORMAT(('2018-10-22T04:00:00' + INTERVAL -14400 SECOND), '%Y-%m-%d\T%H:%i:%s')))))
This causes my query not to return any results.
I've tried removing each tid, one by one, and when one is missing I get results. So I'm thinking I should get both sets of results when they are set to OR
.
To make sure I was reading the SQL correctly, I ran it through a pretty-printer:
To double check, I exported the views config, to see what the yaml said about the WHERE clause, and it all seems to be OR
within the groups:
I even re-imported the configuration from this yaml, but I still get the same results.
How can I get my taxonomy criteria to function using OR
?
Edit In the course of troubleshooting, I tried to simplify the filter criteria. I removed everything, all groups and criteria. This is what I have now:
This is Drupal 8.6.2. We just updated, so I'm wondering if this is a new bug.