BUGFIX: File don't have method URL(), instead, we use $image->URL, which will call $image->getURL()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97783 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Normann Lou 2010-01-28 23:37:51 +00:00 committed by Sam Minnee
parent b853c1ce47
commit 4d6a0e61d0

View File

@ -90,11 +90,10 @@ class SimpleImageField_Disabled extends FormField {
$record = $this->form->getRecord();
$fieldName = $this->name;
if($record) $imageField = $record->$fieldName();
$field = "<div class=\"simpleimage\">";
if($imageField && $imageField->exists()) {
if($imageField->hasMethod('Thumbnail')) $field .= "<img src=\"".$imageField->Thumbnail()->URL()."\" />";
elseif($imageField->CMSThumbnail()) $field .= "<img src=\"".$imageField->CMSThumbnail()->URL()."\" />";
if($imageField->hasMethod('Thumbnail')) $field .= "<img src=\"".$imageField->Thumbnail()->URL."\" />";
elseif($imageField->CMSThumbnail()) $field .= "<img src=\"".$imageField->CMSThumbnail()->URL."\" />";
else {} // This shouldn't be called but it sometimes is for some reason, so we don't do anything
}else{
$field .= "<label>" . _t('SimpleImageField.NOUPLOAD', 'No Image Uploaded') . "</label>";