Mercurial > hg > isophonics-drupal-site
diff core/modules/content_moderation/src/EntityOperations.php @ 18:af1871eacc83
Update to Drupal core 8.7.1
author | Chris Cannam |
---|---|
date | Thu, 09 May 2019 15:33:08 +0100 |
parents | 129ea1e6d783 |
children |
line wrap: on
line diff
--- a/core/modules/content_moderation/src/EntityOperations.php Thu Feb 28 13:21:36 2019 +0000 +++ b/core/modules/content_moderation/src/EntityOperations.php Thu May 09 15:33:08 2019 +0100 @@ -235,10 +235,11 @@ * @see hook_entity_revision_delete() */ public function entityRevisionDelete(EntityInterface $entity) { - /** @var \Drupal\Core\Entity\ContentEntityInterface $entity */ - if (!$entity->isDefaultRevision()) { - $content_moderation_state = ContentModerationStateEntity::loadFromModeratedEntity($entity); - if ($content_moderation_state) { + if ($content_moderation_state = ContentModerationStateEntity::loadFromModeratedEntity($entity)) { + if ($content_moderation_state->isDefaultRevision()) { + $content_moderation_state->delete(); + } + else { $this->entityTypeManager ->getStorage('content_moderation_state') ->deleteRevision($content_moderation_state->getRevisionId());