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.
EFQ's do not natively support an "or" for conditionals (although there are work arounds that use HOOK_query_TAG_alter(), but obviously those don't apply for nosql). This means that you cannot have "or" filters on an EFQ based View.
To replicate:
- Create an arbitrary number of published nodes
- Create an EFQ View of content (nodes)
- Add a filter for node id = 1 (or whatever your first arbitrary node id is)
- Add a filter for node status = 1 (the view preview should display your single published node with the matching id)
- Change the filter operator to "Or" (the view preview will still only display your single node and not all published nodes)
Because this is an issue with EFQ, it's not something to be fixed. However, this should be documented.
Comment | File | Size | Author |
---|---|---|---|
#1 | efq_views_or_support-2108625-1.patch | 761 bytes | jyee |
Comments
Comment #1
jyee CreditAttribution: jyee commentedupdated documentation patch.
p.s. - I guess this module could potentially remove the "Or" option from views, but that seems like a lot of trouble.
Comment #2
jyee CreditAttribution: jyee commentedComment #3
forestmars CreditAttribution: forestmars commentedIs there a core issue for OR support in EFQ? If so, let's link to it here.
jyee's doc patch is RTBC.
Comment #4
chx CreditAttribution: chx commentedOR is supported in Drupal 8 entity query system, it's very different to the D7 one.
Comment #5
chx CreditAttribution: chx commentedAlso, I began to port efq views to D8, it's in my core sandbox under the viewsception branch as I planned to perhaps include it with core.
Comment #6
jyee CreditAttribution: jyee commented@chx Do you think the OR support in D8 can be backported to D7 or are EntityFieldQuery and EntityQuery too different for that to happen?
Comment #7
chx CreditAttribution: chx commentedPHP is turing complete! :D everything is possible, it just would be rather complicated :/
Comment #7.0
chx CreditAttribution: chx commentedcorrected the hook function name
Comment #9
colanDocumentation updated in commit 9bcbb63.
Please reopen if someone wants to take on EFQ.