- fix [ 1177447 ] deployPackage does not retain content pos. for dupl. layouts
This commit is contained in:
parent
059ef037aa
commit
6ed1a66b66
2 changed files with 9 additions and 3 deletions
|
|
@ -53,9 +53,17 @@ sub duplicateBranch {
|
|||
my $self = shift;
|
||||
my $assetToDuplicate = shift || $self;
|
||||
my $newAsset = $self->duplicate($assetToDuplicate);
|
||||
my $contentPositions;
|
||||
$contentPositions = $assetToDuplicate->get("contentPositions");
|
||||
foreach my $child (@{$assetToDuplicate->getLineage(["children"],{returnObjects=>1})}) {
|
||||
$newAsset->duplicateBranch($child);
|
||||
my $newChild = $newAsset->duplicateBranch($child);
|
||||
if ($contentPositions) {
|
||||
my $newChildId = $newChild->getId;
|
||||
my $oldChildId = $child->getId;
|
||||
$contentPositions =~ s/${oldChildId}/${newChildId}/g;
|
||||
}
|
||||
}
|
||||
$newAsset->update({contentPositions=>$contentPositions}) if $contentPositions;
|
||||
return $newAsset;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue