From ce39ad6a14b4647c495f3e19886bbf504ee23565 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 6 Apr 2010 19:10:57 -0700 Subject: [PATCH] Must set cache after updating, since the attribute clears the cache if the ids are different. --- lib/WebGUI/Asset/Wobject/Article.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/Article.pm b/lib/WebGUI/Asset/Wobject/Article.pm index 29617d92b..db381f782 100644 --- a/lib/WebGUI/Asset/Wobject/Article.pm +++ b/lib/WebGUI/Asset/Wobject/Article.pm @@ -184,8 +184,9 @@ sub getStorageLocation { my $self = shift; unless (exists $self->{_storageLocation}) { if ($self->storageId eq "") { - $self->{_storageLocation} = WebGUI::Storage->create($self->session); - $self->update({ storageId => $self->{_storageLocation}->getId }); + my $storage = WebGUI::Storage->create($self->session); + $self->update({ storageId => $storage->getId }); + $self->{_storageLocation} = $storage; } else { $self->{_storageLocation} = WebGUI::Storage->get($self->session,$self->storageId);