diff --git a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php b/core/lib/Drupal/Core/Entity/DatabaseStorageController.php index b07a0e9..94545c7 100644 --- a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php +++ b/core/lib/Drupal/Core/Entity/DatabaseStorageController.php @@ -574,6 +574,9 @@ protected function doLoadFieldItems($entities, $age) { foreach ($fields as $field_name => $field) { $table = $load_current ? static::_fieldTableName($field) : static::_fieldRevisionTableName($field); + // If the field is translatable ensure that only values having valid + // languages are retrieved. Since we are loading values for multiple + // entities, we cannot limit the query to the available translations. $langcodes = $field['translatable'] ? $all_langcodes : array(Language::LANGCODE_NOT_SPECIFIED); $results = $this->database->select($table, 't') ->fields('t')