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:

  1. Create an arbitrary number of published nodes
  2. Create an EFQ View of content (nodes)
  3. Add a filter for node id = 1 (or whatever your first arbitrary node id is)
  4. Add a filter for node status = 1 (the view preview should display your single published node with the matching id)
  5. 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.

CommentFileSizeAuthor
#1 efq_views_or_support-2108625-1.patch761 bytesjyee
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jyee’s picture

updated documentation patch.

p.s. - I guess this module could potentially remove the "Or" option from views, but that seems like a lot of trouble.

jyee’s picture

Status: Active » Needs review
forestmars’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Link to core issue?

Is there a core issue for OR support in EFQ? If so, let's link to it here.

jyee's doc patch is RTBC.

chx’s picture

OR is supported in Drupal 8 entity query system, it's very different to the D7 one.

chx’s picture

Also, 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.

jyee’s picture

@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?

chx’s picture

PHP is turing complete! :D everything is possible, it just would be rather complicated :/

chx’s picture

Issue summary: View changes

corrected the hook function name

  • Commit 9bcbb63 on 7.x-1.x authored by jyee, committed by colan:
    Issue #2108625 by jyee: Documented that 'OR' filter operator is not...
colan’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Documentation updated in commit 9bcbb63.

Please reopen if someone wants to take on EFQ.

Status: Fixed » Closed (fixed)

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