Loading src/EntityClone/Content/ContentEntityCloneBase.php +2 −2 Original line number Diff line number Diff line Loading @@ -285,7 +285,7 @@ class ContentEntityCloneBase implements EntityHandlerInterface, EntityCloneInter $needs_save = FALSE; $moderation_state = ContentModerationState::loadFromModeratedEntity($cloned_entity); $original_translation = $cloned_entity->getUntranslated(); if ($moderation_state->language()->getId() !== $original_translation->language()->getId()) { if ($moderation_state && ($moderation_state->language()->getId() !== $original_translation->language()->getId())) { // If we are cloning a node while not being in the original translation // language, Drupal core will set the default language of the moderation // state to that language whereas the node is simply duplicated and will Loading @@ -297,7 +297,7 @@ class ContentEntityCloneBase implements EntityHandlerInterface, EntityCloneInter foreach ($languages as $language) { $translation = $cloned_entity->getTranslation($language->getId()); if (!$moderation_state->hasTranslation($translation->language()->getId())) { if ($moderation_state && !$moderation_state->hasTranslation($translation->language()->getId())) { // We make a 1 to 1 copy of the moderation state entity from the // original created already by the content_moderation module. This is ok // because even if translations can be in different moderation states, Loading Loading
src/EntityClone/Content/ContentEntityCloneBase.php +2 −2 Original line number Diff line number Diff line Loading @@ -285,7 +285,7 @@ class ContentEntityCloneBase implements EntityHandlerInterface, EntityCloneInter $needs_save = FALSE; $moderation_state = ContentModerationState::loadFromModeratedEntity($cloned_entity); $original_translation = $cloned_entity->getUntranslated(); if ($moderation_state->language()->getId() !== $original_translation->language()->getId()) { if ($moderation_state && ($moderation_state->language()->getId() !== $original_translation->language()->getId())) { // If we are cloning a node while not being in the original translation // language, Drupal core will set the default language of the moderation // state to that language whereas the node is simply duplicated and will Loading @@ -297,7 +297,7 @@ class ContentEntityCloneBase implements EntityHandlerInterface, EntityCloneInter foreach ($languages as $language) { $translation = $cloned_entity->getTranslation($language->getId()); if (!$moderation_state->hasTranslation($translation->language()->getId())) { if ($moderation_state && !$moderation_state->hasTranslation($translation->language()->getId())) { // We make a 1 to 1 copy of the moderation state entity from the // original created already by the content_moderation module. This is ok // because even if translations can be in different moderation states, Loading