diff --git a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php index 0d89b21..b74cbec 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php @@ -261,15 +261,15 @@ public function loadMultipleRevisions(array $revision_ids) { // once. $entity_groups = []; foreach ($revisions as $revision) { - $id = $revision->id(); + $entity_id = $revision->id(); foreach ($entity_groups as &$entity_group) { - if (!isset($entity_group[$id])) { - $entity_group[$id] = $revision; + if (!isset($entity_group[$entity_id])) { + $entity_group[$entity_id] = $revision; continue 2; } } // If no suitable group has been found then create a new one. - $entity_groups[] = [$id => $revision]; + $entity_groups[] = [$entity_id => $revision]; } // Invoke the entity hooks for each group. diff --git a/core/lib/Drupal/Core/Entity/EntityStorageInterface.php b/core/lib/Drupal/Core/Entity/EntityStorageInterface.php index 4b5b837..052988c 100644 --- a/core/lib/Drupal/Core/Entity/EntityStorageInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityStorageInterface.php @@ -89,7 +89,8 @@ public function loadRevision($revision_id); * An array of revision IDs to load. * * @return \Drupal\Core\Entity\EntityInterface[] - * The specified entity revisions or an empty array if none found. + * An array of entity revisions keyed by their revision ID, 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 c745b1d..3881656 100644 --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php @@ -617,7 +617,7 @@ protected function doLoadRevisionFieldItems($revision_ids) { // Support the case when a single revision ID is passed in. $load_single = FALSE; if (!is_array($revision_ids)) { - @trigger_error('Passing a single revision ID to "\Drupal\Core\Entity\ContentEntityStorageBase::doLoadRevisionFieldItems()" is deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.0. An array of revision IDs should be given instead.', E_USER_DEPRECATED); + @trigger_error('Passing a single revision ID to "\Drupal\Core\Entity\ContentEntityStorageBase::doLoadRevisionFieldItems()" is deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.0. An array of revision IDs should be given instead. See https://www.drupal.org/node/2924915.', E_USER_DEPRECATED); $revision_ids = (array) $revision_ids; $load_single = TRUE; } diff --git a/core/tests/Drupal/Tests/Listeners/DeprecationListener.php b/core/tests/Drupal/Tests/Listeners/DeprecationListener.php index 7030353..0c1a8ab 100644 --- a/core/tests/Drupal/Tests/Listeners/DeprecationListener.php +++ b/core/tests/Drupal/Tests/Listeners/DeprecationListener.php @@ -111,7 +111,7 @@ public static function getSkippedDeprecations() { 'The Drupal\migrate_drupal\Plugin\migrate\source\d6\i18nVariable is deprecated in Drupal 8.4.0 and will be removed before Drupal 9.0.0. Instead, use Drupal\migrate_drupal\Plugin\migrate\source\d6\VariableTranslation', 'Implicit cacheability metadata bubbling (onto the global render context) in normalizers is deprecated since Drupal 8.5.0 and will be removed in Drupal 9.0.0. Use the "cacheability" serialization context instead, for explicit cacheability metadata bubbling. See https://www.drupal.org/node/2918937', 'Automatically creating the first item for computed fields is deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.0. Use \Drupal\Core\TypedData\ComputedItemListTrait instead.', - 'Passing a single revision ID to "\Drupal\Core\Entity\ContentEntityStorageBase::doLoadRevisionFieldItems()" is deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.0. An array of revision IDs should be given instead.', + 'Passing a single revision ID to "\Drupal\Core\Entity\ContentEntityStorageBase::doLoadRevisionFieldItems()" is deprecated in Drupal 8.5.x and will be removed before Drupal 9.0.0. An array of revision IDs should be given instead. See https://www.drupal.org/node/2924915.', ]; }