diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index b5cdbbe34..9f6a68e7d 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -13,6 +13,7 @@ - fixed #11347: copy forum - fixed #11359: USPS International shipping does not work on United Kingdom - fixed #11034: Upgrade errors -- 7.6.35 to 7.7.17 + - fixed #11346: Slow rendering of Thread asset with a lot of attachments 7.8.9 - fixed #11235: wiki search diff --git a/lib/WebGUI/Storage.pm b/lib/WebGUI/Storage.pm index 2bf5898a2..a75149a0b 100644 --- a/lib/WebGUI/Storage.pm +++ b/lib/WebGUI/Storage.pm @@ -1247,14 +1247,15 @@ sub getThumbnailUrl { my $self = shift; my $filename = shift; if (! defined $filename) { - $self->session->errorHandler->error("Can't make a thumbnail url without a filename."); + $self->session->errorHandler->error("Can't find a thumbnail url without a filename."); return ''; } - if (! isIn($filename, @{ $self->getFiles() })) { - $self->session->errorHandler->error("Can't make a thumbnail for a file named '$filename' that is not in my storage location."); + my $thumbname = 'thumb-' . $filename; + if (! -e $self->getPath($thumbname)) { + $self->session->errorHandler->error("Can't find a thumbnail for a file named '$filename' that is not in my storage location."); return ''; } - return $self->getUrl("thumb-".$filename); + return $self->getUrl($thumbname); } #------------------------------------------------------------------- diff --git a/t/Storage/Image.t b/t/Storage/Image.t index fb6441638..4a04d5bcd 100644 --- a/t/Storage/Image.t +++ b/t/Storage/Image.t @@ -203,10 +203,10 @@ is($imageCopy->deleteFile('../../'), undef, 'deleteFile in Storage::Image also r #################################################### is($thumbStore->getThumbnailUrl(), '', 'getThumbnailUrl returns undef if no file is sent'); -is($WebGUI::Test::logger_error, q/Can't make a thumbnail url without a filename./, 'getThumbnailUrl logs an error message for not sending a filename'); +is($WebGUI::Test::logger_error, q/Can't find a thumbnail url without a filename./, 'getThumbnailUrl logs an error message for not sending a filename'); is($thumbStore->getThumbnailUrl('round.png'), '', 'getThumbnailUrl returns undef if the requested file is not in the storage location'); -is($WebGUI::Test::logger_error, q/Can't make a thumbnail for a file named 'round.png' that is not in my storage location./, 'getThumbnailUrl logs an error message for not sending a filename'); +is($WebGUI::Test::logger_error, q/Can't find a thumbnail for a file named 'round.png' that is not in my storage location./, 'getThumbnailUrl logs an error message for not sending a filename'); is($thumbStore->getThumbnailUrl('square.png'), $thumbStore->getUrl('thumb-square.png'), 'getThumbnailUrl returns the correct url');