|
|
@ -987,8 +987,8 @@ class Elements extends Component |
|
|
|
throw new UnsupportedSiteException($element, $mainClone->siteId, 'Attempting to duplicate an element in an unsupported site.'); |
|
|
|
} |
|
|
|
|
|
|
|
// If this is a draft, create a new draft row
|
|
|
|
if ($mainClone->draftId) { |
|
|
|
// If we are duplicating a draft as another draft, create a new draft row
|
|
|
|
if ($mainClone->draftId && $mainClone->draftId === $element->draftId) { |
|
|
|
/** @var ElementInterface|DraftBehavior $element */ |
|
|
|
$mainClone->draftId = Craft::$app->getDrafts()->insertDraftRow(Craft::t('app', 'First draft'), null, Craft::$app->getUser()->getId()); |
|
|
|
} |
|
|
|