Skip to content

Commit

Permalink
Set UID to null so new UID is generated on duplication.
Browse files Browse the repository at this point in the history
Closes craftcms#4653 for the 3.1 branch.
  • Loading branch information
TonyDeStefano authored and Ryan McQuen committed Dec 6, 2019
1 parent c8ec5f0 commit 738c4c3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/services/Elements.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ public function duplicateElement(ElementInterface $element, array $newAttributes
$mainClone->setAttributes($newAttributes, false);
$mainClone->duplicateOf = $element;
$mainClone->id = null;
$mainClone->uid = null;
$mainClone->contentId = null;

// Make sure the element actually supports its own site ID
Expand Down

0 comments on commit 738c4c3

Please sign in to comment.