- fix [ 1177447 ] deployPackage does not retain content pos. for dupl. layouts

This commit is contained in:
Matthew Wilson 2005-08-24 01:57:56 +00:00
parent 059ef037aa
commit 6ed1a66b66
2 changed files with 9 additions and 3 deletions

View file

@ -67,10 +67,8 @@ sub _formatFunction {
my $url;
if (exists $function->{func}) {
$url = WebGUI::URL::page("func=".$function->{func});
$url = '#' if $session{form}{func} eq $function->{func};
} else {
$url = WebGUI::URL::page("op=".$function->{op});
$url = '#' if $session{form}{op} eq $function->{op};
}
return {
title=>WebGUI::International::get($function->{title}{id}, $function->{title}{namespace}),

View file

@ -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;
}