Asset->get should return a copy of the properties hashref
This commit is contained in:
parent
7a14ebd639
commit
b92da4afab
3 changed files with 5 additions and 3 deletions
|
|
@ -461,7 +461,8 @@ sub get {
|
|||
if (defined $propertyName) {
|
||||
return $self->{_properties}{$propertyName};
|
||||
}
|
||||
return $self->{_properties};
|
||||
my %copyOfHashRef = %{$self->{_properties}};
|
||||
return \%copyOfHashRef;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -78,8 +78,7 @@ Assets that normally autocommit their workflows (like CS Posts, and Wiki Pages)
|
|||
sub duplicate {
|
||||
my $self = shift;
|
||||
my $options = shift;
|
||||
my %assetProperties = %{$self->get()};
|
||||
my $newAsset = $self->getParent->addChild(\%assetProperties, undef, undef, {skipAutoCommitWorkflows=>$options->{skipAutoCommitWorkflows}});
|
||||
my $newAsset = $self->getParent->addChild($self->get, 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