diff --git a/core/modules/entity/lib/Drupal/entity/EntityFieldQuery.php b/core/modules/entity/lib/Drupal/entity/EntityFieldQuery.php index 68b40b9..b67f22b 100644 --- a/core/modules/entity/lib/Drupal/entity/EntityFieldQuery.php +++ b/core/modules/entity/lib/Drupal/entity/EntityFieldQuery.php @@ -846,12 +846,14 @@ class EntityFieldQuery { $id_map['bundle'] = $sql_field; if (isset($this->entityConditions['bundle'])) { if (!empty($entity_info['entity keys']['bundle'])) { - $this->addCondition($select_query, $base_table . '.' . $sql_field, $this->entityConditions['bundle'], $having); + $this->addCondition($select_query, $sql_field, $this->entityConditions['bundle'], $having); } else { - $this->addCondition($select_query, $sql_field, $this->entityConditions['bundle'], $having); + // This entity has no bundle, so invalidate the query. + $select_query->where('1 = 0'); } } + } // Order the query. foreach ($this->order as $order) {