Asset->get should return a copy of the properties hashref

This commit is contained in:
JT Smith 2007-01-29 17:53:56 +00:00
parent 7a14ebd639
commit b92da4afab
3 changed files with 5 additions and 3 deletions

View file

@ -1,6 +1,8 @@
7.3.9
- fix: Can't add task to project management (perlDreamer Consulting, LLC)
- fix: Error in RSS Feed (perlDreamer Consulting, LLC)
- rfe: Asset->get should return a copy of the properties hashref
7.3.8
- Fixed a template variable rewriting problem with HTML::Template::Expr

View file

@ -461,7 +461,8 @@ sub get {
if (defined $propertyName) {
return $self->{_properties}{$propertyName};
}
return $self->{_properties};
my %copyOfHashRef = %{$self->{_properties}};
return \%copyOfHashRef;
}

View file

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