diff --git a/core/modules/content_moderation/src/Plugin/Validation/Constraint/ModerationStateConstraintValidator.php b/core/modules/content_moderation/src/Plugin/Validation/Constraint/ModerationStateConstraintValidator.php index 70f0e87..b664c65 100644 --- a/core/modules/content_moderation/src/Plugin/Validation/Constraint/ModerationStateConstraintValidator.php +++ b/core/modules/content_moderation/src/Plugin/Validation/Constraint/ModerationStateConstraintValidator.php @@ -118,7 +118,7 @@ protected function isFirstTimeModeration(EntityInterface $entity) { $original_entity = $this->moderationInformation->getLatestRevision($entity->getEntityTypeId(), $entity->id()); if ($original_entity) { - $original_id = $original_entity->moderation_state->target_id; + $original_id = $original_entity->moderation_state; } return !($entity->moderation_state && $original_entity && $original_id); diff --git a/core/modules/content_moderation/tests/modules/content_moderation_test_grants/content_moderation_test_grants.info.yml b/core/modules/content_moderation/tests/modules/content_moderation_test_grants/content_moderation_test_grants.info.yml deleted file mode 100644 index 825c861..0000000 --- a/core/modules/content_moderation/tests/modules/content_moderation_test_grants/content_moderation_test_grants.info.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: 'Content moderation test grants' -type: module -description: 'Implements hook_node_grants() for testing.' -package: Testing -version: VERSION -core: 8.x -dependencies: - - node diff --git a/core/modules/content_moderation/tests/modules/content_moderation_test_grants/content_moderation_test_grants.module b/core/modules/content_moderation/tests/modules/content_moderation_test_grants/content_moderation_test_grants.module deleted file mode 100644 index 1b71c19..0000000 --- a/core/modules/content_moderation/tests/modules/content_moderation_test_grants/content_moderation_test_grants.module +++ /dev/null @@ -1,15 +0,0 @@ -createContentTypeFromUi('Moderated content', 'moderated_content', TRUE); $this->grantUserPermissionToCreateContentOfType($this->adminUser, 'moderated_content'); - // Rebuild permissions because hook_node_grants() implemented. + // Rebuild permissions because hook_node_grants() is implemented by the + // node_access_test_empty module. node_access_rebuild(); } @@ -75,7 +76,6 @@ public function testPageAccess() { // Now make a new user and verify that the new user's access is correct. $user = $this->createUser([ 'use editorial transition create_new_draft', - 'use editorial transition publish', 'view latest version', 'view any unpublished content', ]);