mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
b853c1ce47
commit
4d6a0e61d0
@ -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>";
|
||||
|
Loading…
Reference in New Issue
Block a user