BUGFIX #3441 funkygibbon: Stop ThumbnailStripField breaking on orphaned images

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@70997 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-01-30 01:30:20 +00:00
parent d8687d4063
commit 9086994807

View File

@ -64,7 +64,7 @@ class ThumbnailStripField extends FormField {
$result .= '<ul>'; $result .= '<ul>';
foreach($images as $image) { foreach($images as $image) {
$thumbnail = $image->getFormattedImage('StripThumbnail'); $thumbnail = $image->getFormattedImage('StripThumbnail');
if ($thumbnail instanceof Image_Cached) { //Hack here...
// Constrain the output image to a 600x600 square. This is passed to the destwidth/destheight in the class, which are then used to // Constrain the output image to a 600x600 square. This is passed to the destwidth/destheight in the class, which are then used to
// set width & height properties on the <img> tag inserted into the CMS. Resampling is done after save // set width & height properties on the <img> tag inserted into the CMS. Resampling is done after save
$width = $image->Width; $width = $image->Width;
@ -85,6 +85,7 @@ class ThumbnailStripField extends FormField {
'</a>' . '</a>' .
'</li>'; '</li>';
} }
}
$result .= '</ul>'; $result .= '</ul>';
} else { } else {
if($folder) { if($folder) {