X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcontent_moderation%2Fsrc%2FPlugin%2FWorkflowType%2FContentModeration.php;fp=web%2Fcore%2Fmodules%2Fcontent_moderation%2Fsrc%2FPlugin%2FWorkflowType%2FContentModeration.php;h=2e8d27ffa83a0ef292aa296278f392f5211af250;hp=51605d5383d68aa9113afffcceabfe7ef49fe5f7;hb=bfbba508964731508b9bd6d5835c2edc858db95b;hpb=cb9a80db11fc6b014e5b1e693a5a391c95eb5d9a diff --git a/web/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php b/web/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php index 51605d538..2e8d27ffa 100644 --- a/web/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php +++ b/web/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php @@ -295,7 +295,7 @@ class ContentModeration extends WorkflowTypeBase implements ContainerFactoryPlug */ public function getInitialState(WorkflowInterface $workflow, $entity = NULL) { if ($entity instanceof EntityPublishedInterface) { - return $workflow->getState($entity->isPublished() ? 'published' : 'draft'); + return $workflow->getState($entity->isPublished() && !$entity->isNew() ? 'published' : 'draft'); } return parent::getInitialState($workflow); }