diff --git a/core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php b/core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php index 49bd256..917b9a5 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityDatabaseStorage.php @@ -166,6 +166,17 @@ protected function getFromStorage(array $ids = NULL) { // Map the loaded records into entity objects and according fields. if ($records) { $entities = $this->mapFromStorageRecords($records); + + // Call hook_entity_storage_load(). + foreach ($this->moduleHandler()->getImplementations('entity_storage_load') as $module) { + $function = $module . '_entity_storage_load'; + $function($entities, $this->entityTypeId); + } + // Call hook_TYPE_storage_load(). + foreach ($this->moduleHandler()->getImplementations($this->entityTypeId . 'storage__load') as $module) { + $function = $module . '_' . $this->entityTypeId . '_storage_load'; + $function($entities); + } } } diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 18f0a57..ab564d0 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -855,11 +855,11 @@ function comment_translation_configuration_element_submit($form, &$form_state) { } /** - * Implements hook_entity_load(). + * Implements hook_entity_storage_load(). * * @see \Drupal\comment\Plugin\Field\FieldType\CommentItem::propertyDefinitions() */ -function comment_entity_load($entities, $entity_type) { +function comment_entity_storage_load($entities, $entity_type) { // Comments can only be attached to content entities, so skip others. if (!\Drupal::entityManager()->getDefinition($entity_type)->isSubclassOf('Drupal\Core\Entity\ContentEntityInterface')) { return; diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module index 502d4e4..70d1eb2 100644 --- a/core/modules/content_translation/content_translation.module +++ b/core/modules/content_translation/content_translation.module @@ -501,9 +501,9 @@ function content_translation_language_fallback_candidates_entity_view_alter(&$ca } /** - * Implements hook_entity_load(). + * Implements hook_entity_storage_load(). */ -function content_translation_entity_load(array $entities, $entity_type) { +function content_translation_entity_storage_load(array $entities, $entity_type) { $enabled_entities = array(); if (content_translation_enabled($entity_type)) { diff --git a/core/modules/forum/forum.module b/core/modules/forum/forum.module index 1b9b8f8..2d55ba9 100644 --- a/core/modules/forum/forum.module +++ b/core/modules/forum/forum.module @@ -383,9 +383,9 @@ function forum_node_predelete(EntityInterface $node) { } /** - * Implements hook_node_load(). + * Implements hook_node_storage_load(). */ -function forum_node_load($nodes) { +function forum_node_storage_load($nodes) { $node_vids = array(); foreach ($nodes as $node) { if (\Drupal::service('forum_manager')->checkNodeType($node)) { diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module index 8ea735b..f03b28f 100644 --- a/core/modules/rdf/rdf.module +++ b/core/modules/rdf/rdf.module @@ -224,9 +224,9 @@ function rdf_entity_prepare_view($entity_type, array $entities, array $displays) } /** - * Implements hook_comment_load(). + * Implements hook_comment_storage_load(). */ -function rdf_comment_load($comments) { +function rdf_comment_storage_load($comments) { foreach ($comments as $comment) { // Pages with many comments can show poor performance. This information // isn't needed until rdf_preprocess_comment() is called, but set it here