fix problem revealed by tests

update() in a File asset would always create a storage location if one
was not yet saved. calling update() in a filter method would cause
another one to be created too, messing up the tests.
This commit is contained in:
Doug Bell 2010-11-16 20:53:00 -06:00
parent 8c4785b165
commit 19dedc0b7c
2 changed files with 2 additions and 1 deletions

View file

@ -628,7 +628,7 @@ sub update {
$self->SUPER::update(@_); $self->SUPER::update(@_);
##update may have entered a new storageId. Reset the cached one just in case. ##update may have entered a new storageId. Reset the cached one just in case.
if ($self->get("storageId") ne $before{storageId}) { if ($self->get("storageId") ne $before{storageId}) {
$self->setStorageLocation; delete $self->{_storageLocation};
} }
if ($self->get("ownerUserId") ne $before{owner} || $self->get("groupIdEdit") ne $before{edit} || $self->get("groupIdView") ne $before{view}) { if ($self->get("ownerUserId") ne $before{owner} || $self->get("groupIdEdit") ne $before{edit} || $self->get("groupIdView") ne $before{view}) {
$self->setPrivileges; $self->setPrivileges;

View file

@ -1017,6 +1017,7 @@ use HTML::Packer;
my $asset = WebGUI::Asset->getImportNode( $session )->addChild({ my $asset = WebGUI::Asset->getImportNode( $session )->addChild({
className => 'WebGUI::Asset::Snippet', className => 'WebGUI::Asset::Snippet',
}); });
addToCleanup( $asset );
my $unpacked = qq{<title> my $unpacked = qq{<title>