fixed a duplicate bug where the original asset would get trashed
This commit is contained in:
parent
dc8cbd5fb2
commit
f94791fed0
1 changed files with 2 additions and 1 deletions
|
|
@ -78,7 +78,8 @@ Assets that normally autocommit their workflows (like CS Posts, and Wiki Pages)
|
|||
sub duplicate {
|
||||
my $self = shift;
|
||||
my $options = shift;
|
||||
my $newAsset = $self->getParent->addChild($self->get, undef, undef, {skipAutoCommitWorkflows=>$options->{skipAutoCommitWorkflows}});
|
||||
my %assetProperties = %{$self->get()};
|
||||
my $newAsset = $self->getParent->addChild(\%assetProperties, undef, undef, {skipAutoCommitWorkflows=>$options->{skipAutoCommitWorkflows}});
|
||||
my $sth = $self->session->db->read("select * from metaData_values where assetId = ?", [$self->getId]);
|
||||
while (my $h = $sth->hashRef) {
|
||||
$self->session->db->write("insert into metaData_values (fieldId, assetId, value) values (?, ?, ?)", [$h->{fieldId}, $newAsset->getId, $h->{value}]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue