Improving on this
This commit is contained in:
parent
48c2d9a962
commit
1162ca6650
1 changed files with 4 additions and 2 deletions
|
|
@ -145,13 +145,15 @@ sub getValueFromPost {
|
|||
if (defined $id) {
|
||||
my $storage = WebGUI::Storage::Image->get($self->session, $id);
|
||||
if (defined $storage) {
|
||||
my $atLeastOneImage = 0;
|
||||
foreach my $file (@{$storage->getFiles}) {
|
||||
if ($storage->isImage($file)) {
|
||||
$storage->generateThumbnail($file);
|
||||
$atLeastOneImage = 1;
|
||||
}
|
||||
elsif ($self->get("forceImageOnly")) {
|
||||
$storage->delete;
|
||||
$id = undef;
|
||||
$storage->deleteFile($file);
|
||||
$id = undef unless $atLeastOneImage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue