Make sure template attachments are duplicated. Fixes bug #11355.
This commit is contained in:
parent
1e7f443126
commit
6fe662ef83
3 changed files with 11 additions and 1 deletions
|
|
@ -9,6 +9,7 @@
|
|||
- fixed #11350: Story Topic asset missing description...
|
||||
- fixed #11351: Double submits on ITransact checkout
|
||||
- fixed #11353: shop - sales - error
|
||||
- fixed #11355: Duplicate template error
|
||||
|
||||
7.8.9
|
||||
- fixed #11235: wiki search
|
||||
|
|
|
|||
|
|
@ -189,6 +189,7 @@ sub duplicate {
|
|||
my $self = shift;
|
||||
my $newTemplate = $self->SUPER::duplicate;
|
||||
$newTemplate->update({isDefault => 0});
|
||||
$newTemplate->addAttachments($self->getAttachments);
|
||||
return $newTemplate;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use WebGUI::Test;
|
|||
use WebGUI::Session;
|
||||
use WebGUI::Asset::Template;
|
||||
use Exception::Class;
|
||||
use Test::More tests => 43; # increment this value for each test you create
|
||||
use Test::More tests => 44; # increment this value for each test you create
|
||||
use Test::Deep;
|
||||
use JSON qw{ from_json };
|
||||
|
||||
|
|
@ -103,6 +103,14 @@ ok(exists $session->style->{_javascript}->{$_}, "$_ in style") for qw(foo bar bo
|
|||
# sleep so the revisiondate isn't duplicated
|
||||
sleep 1;
|
||||
|
||||
my $template3dup = $template3->duplicate;
|
||||
my @atts3dup = map { delete @{ $_ }{qw/attachId templateId revisionDate/}; $_; } @{ $template3dup->getAttachments };
|
||||
cmp_bag(
|
||||
[@atts3dup],
|
||||
[@atts],
|
||||
'attachments are duplicated'
|
||||
);
|
||||
|
||||
my $template3rev = $template3->addRevision();
|
||||
my $att4 = $template3rev->getAttachments('headScript');
|
||||
is($att4->[0]->{url}, 'foo', 'rev has foo');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue