diff --git a/core/modules/content_moderation/content_moderation.info.yml b/core/modules/content_moderation/content_moderation.info.yml index f60c584..12f6059 100644 --- a/core/modules/content_moderation/content_moderation.info.yml +++ b/core/modules/content_moderation/content_moderation.info.yml @@ -1,6 +1,6 @@ -name: Content moderation +name: 'Content Moderation' type: module -description: Provides moderation states for content +description: 'Provides moderation states for content' version: VERSION core: 8.x package: Core (Experimental) diff --git a/core/modules/content_moderation/content_moderation.module b/core/modules/content_moderation/content_moderation.module index 15a1edc..2d04b37 100644 --- a/core/modules/content_moderation/content_moderation.module +++ b/core/modules/content_moderation/content_moderation.module @@ -86,10 +86,15 @@ function content_moderation_entity_bundle_field_info_alter(&$fields, EntityTypeI } /** - * Implements hook_entity_load(). + * Implements hook_entity_storage_load(). */ function content_moderation_entity_storage_load(array $entities, $entity_type_id) { - return \Drupal::service('content_moderation.entity_operations')->entityStorageLoad($entities, $entity_type_id); + // Work around the fact that this hook might be called when the container is + // not fully initialized after the module has been enabled. + // @todo Remove this check after https://www.drupal.org/node/2753733 is fixed. + if (\Drupal::hasService('content_moderation.entity_operations')) { + \Drupal::service('content_moderation.entity_operations')->entityStorageLoad($entities, $entity_type_id); + } } /** @@ -161,7 +166,7 @@ function content_moderation_entity_view(array &$build, EntityInterface $entity, } /** - * Implements hook_entity_access(). + * Implements hook_node_access(). * * Nodes in particular should be viewable if unpublished and the user has * the appropriate permission. This permission is therefore effectively