diff --git a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php index 5b9ec6a..fb2bbad 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php @@ -616,15 +616,15 @@ protected function populateAffectedRevisionTranslations(ContentEntityInterface $ * * @param array $ids * The entity key values to verify. - * @param string $key + * @param string $entity_key * (optional) The entity key to sanitise values for. Defaults to 'id'. * * @return array * The sanitized list of entity key values. */ - protected function cleanIds(array $ids, $key = 'id') { + protected function cleanIds(array $ids, $entity_key = 'id') { $definitions = $this->entityManager->getBaseFieldDefinitions($this->entityTypeId); - $field_name = $this->entityType->getKey($key); + $field_name = $this->entityType->getKey($entity_key); if ($field_name && $definitions[$field_name]->getType() == 'integer') { $ids = array_filter($ids, function ($id) { return is_numeric($id) && $id == (int) $id; diff --git a/core/lib/Drupal/Core/Entity/EntityStorageInterface.php b/core/lib/Drupal/Core/Entity/EntityStorageInterface.php index 77df2a2..4b5b837 100644 --- a/core/lib/Drupal/Core/Entity/EntityStorageInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityStorageInterface.php @@ -83,13 +83,13 @@ public function loadUnchanged($id); public function loadRevision($revision_id); /** - * Loads multiple revisions. + * Loads multiple entity revisions. * * @param array $revision_ids * An array of revision IDs to load. * * @return \Drupal\Core\Entity\EntityInterface[] - * The specified entity revisions or empty array if none found. + * The specified entity revisions or an empty array if none found. */ public function loadMultipleRevisions(array $revision_ids); diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php index 3349275..aedd831 100644 --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php @@ -636,7 +636,7 @@ protected function doLoadRevisionFieldItems($revision_ids) { } } - return $load_single ? (isset($revisions[$revision_ids]) ? $revisions[$revision_ids] : NULL) : $revisions; + return $load_single ? (!empty($revisions) ? reset($revisions) : NULL) : $revisions; } /**