fix a bug where updating the storageId in File Type assets did not update the cached storageLocation. Also fixed the Thumbnail Macro test

This commit is contained in:
Colin Kuskie 2006-12-09 06:05:26 +00:00
parent 332933337a
commit 2c246c06cc
6 changed files with 195 additions and 11 deletions

View file

@ -148,11 +148,12 @@ sub getEditForm {
#-------------------------------------------------------------------
sub getStorageLocation {
my $self = shift;
unless (exists $self->{_storageLocation}) {
if ($self->get("storageId") eq "") {
$self->{_storageLocation} = WebGUI::Storage::Image->create($self->session);
$self->{_storageLocation} = WebGUI::Storage::Image->create($self->session);
$self->update({storageId=>$self->{_storageLocation}->getId});
} else {
$self->{_storageLocation} = WebGUI::Storage::Image->get($self->session,$self->get("storageId"));
@ -222,6 +223,18 @@ sub setSize {
return $self->SUPER::setSize($size);
}
#-------------------------------------------------------------------
sub setStorageLocation {
my $self = shift;
if ($self->get("storageId") eq "") {
$self->{_storageLocation} = WebGUI::Storage::Image->create($self->session);
$self->update({storageId=>$self->{_storageLocation}->getId});
} else {
$self->{_storageLocation} = WebGUI::Storage::Image->get($self->session,$self->get("storageId"));
}
}
#-------------------------------------------------------------------
sub view {
my $self = shift;