From 19dedc0b7cc82d172e02ef6fd0497fce24d80a38 Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Tue, 16 Nov 2010 20:53:00 -0600 Subject: [PATCH] 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. --- lib/WebGUI/Asset/File.pm | 2 +- t/Asset/Asset.t | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/WebGUI/Asset/File.pm b/lib/WebGUI/Asset/File.pm index 6d223bf53..dc087e234 100644 --- a/lib/WebGUI/Asset/File.pm +++ b/lib/WebGUI/Asset/File.pm @@ -628,7 +628,7 @@ sub update { $self->SUPER::update(@_); ##update may have entered a new storageId. Reset the cached one just in case. 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}) { $self->setPrivileges; diff --git a/t/Asset/Asset.t b/t/Asset/Asset.t index 62203e141..9fc631575 100644 --- a/t/Asset/Asset.t +++ b/t/Asset/Asset.t @@ -1017,6 +1017,7 @@ use HTML::Packer; my $asset = WebGUI::Asset->getImportNode( $session )->addChild({ className => 'WebGUI::Asset::Snippet', }); +addToCleanup( $asset ); my $unpacked = qq{