Fix newByPropertyHashRef, which is required for class dispatch. Add tests. Fix addChild to use newByPropertyHashRef.

This commit is contained in:
Colin Kuskie 2010-01-20 18:44:48 -08:00
parent 36d1636f06
commit caa1f330b8
3 changed files with 19 additions and 9 deletions

View file

@ -85,7 +85,7 @@ sub addChild {
$session->db->commit;
$properties->{assetId} = $id;
$properties->{parentId} = $self->getId;
my $temp = WebGUI::Asset->new($session,$properties) || croak "Couldn't create a new $properties->{className} asset!";
my $temp = WebGUI::Asset->newByPropertyHashRef($session, $properties) || croak "Couldn't create a new $properties->{className} asset!";
my $newAsset = $temp->addRevision($properties, $now, $options);
$self->updateHistory("added child ".$id);
$session->http->setStatus(201,"Asset Creation Successful");