diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php index a725a11..28a5afa 100644 --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php @@ -1637,7 +1637,9 @@ public function countFieldData($storage_definition, $as_bool = FALSE) { // If we are performing the query just to check if the field has data // limit the number of rows. if ($as_bool) { - $query->addExpression('1'); + $query + ->range(0, 1) + ->addExpression('1'); } else { // Otherwise count the number of rows.