Reverting previous work. Asset->new must return an Asset, even if
no className is passed and the invocant's class is Asset. This is due to the root. In the db, the root Asset has the className WebGUI::Asset, and the getRoot method matches this. Changed the failing test in Asset.t to look for a WebGUI::Asset to be returned. Added two tests to Asset.t to validate the object returned by Asset->getRoot method. Reverted previous work and updated the POD for Asset->new.
This commit is contained in:
parent
c956ba3969
commit
000b2fcce3
3 changed files with 11 additions and 10 deletions
|
|
@ -1361,7 +1361,7 @@ sub manageAssetsSearch {
|
|||
|
||||
=head2 new ( session, assetId [, className, revisionDate ] )
|
||||
|
||||
Constructor. This does not create an asset. Returns a new object if it can, otherwise returns undef.
|
||||
Constructor. This does not create an asset.
|
||||
|
||||
=head3 session
|
||||
|
||||
|
|
@ -1377,7 +1377,8 @@ By default we'll use whatever class it is called by like WebGUI::Asset::File->ne
|
|||
|
||||
=head3 revisionDate
|
||||
|
||||
An epoch date that represents a specific version of an asset. By default the most recent version will be used.
|
||||
An epoch date that represents a specific version of an asset. By default the most recent version will be used. If
|
||||
no revision date is available it will return undef.
|
||||
|
||||
=cut
|
||||
|
||||
|
|
@ -1406,7 +1407,6 @@ sub new {
|
|||
}
|
||||
$class = $className;
|
||||
}
|
||||
return undef if $class eq 'WebGUI::Asset';
|
||||
my $cache = WebGUI::Cache->new($session, ["asset",$assetId,$revisionDate]);
|
||||
my $properties = $cache->get;
|
||||
if (exists $properties->{assetId}) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue