Problem/Motivation
When using a condition OR group, using two different relationship conditions, but filtering on the same field name on both relationships. You get incorrect results. Only the first condition is properly applied, and not the second.
Steps to reproduce
Node type page has two fields:field_first_relationshipfield_second_relationship
Each one is an entity reference to a different Taxonomy vocabulary (I haven't tried whether this issue exists if both pointing to the same vocab, I assume it will do though).
On both taxonomy vocabs there's a field field_boolean
Entity query:
$query = Drupal::entityQuery('node');
$group = $query->orConditionGroup()
->condition('field_first_relationship.entity:taxonomy_term.field_boolean', 1)
->condition('field_second_relationship.entity:taxonomy_term.field_boolean', 1);
$query->condition($group);
$results = $query->execute();
Expected results:
I should get back all nodes that have a reference on either field to a taxonomy term with field_boolean: 1
Actual results:
I only get back nodes with a reference on field_first_relationship to a taxonomy term with field_boolean: 1.field_second_relationship is ignored.