Upgraded drupal core with security updates
[yaffs-website] / web / core / modules / content_moderation / src / Plugin / WorkflowType / ContentModeration.php
index 51605d5383d68aa9113afffcceabfe7ef49fe5f7..2e8d27ffa83a0ef292aa296278f392f5211af250 100644 (file)
@@ -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);
   }