Skip to content

Commit

Permalink
Avoid referencing UID 0 not on purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksm authored Nov 3, 2024
1 parent 5a92b22 commit ba8cb27
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Drupal/Driver/Fields/Drupal8/EntityReferenceHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ public function expand($values) {
foreach ((array) $values as $value) {
$query = \Drupal::entityQuery($entity_type_id);
$or = $query->orConditionGroup();
$or->condition($id_key, $value)
$id_group = $query->andConditionGroup()
->condition($id_key, $value)
->condition($id_key, 0, '<>');
$or->condition($id_group)
->condition($label_key, $value);
$query->condition($or);
$query->accessCheck(FALSE);
Expand Down

0 comments on commit ba8cb27

Please sign in to comment.