mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
BUGFIX If image does not exist in the file system, don't show a non-object error when viewing the Image/File record in AssetTableField (from r82390)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@89812 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
65a9830b13
commit
2436d7869a
@ -161,7 +161,8 @@ class AssetTableField extends ComplexTableField {
|
||||
$tab = $detailFormFields->findOrMakeTab("BottomRoot.Image", _t('AssetTableField.IMAGE', 'Image'));
|
||||
|
||||
$big = $childData->URL;
|
||||
$thumbnail = $childData->getFormattedImage('AssetLibraryPreview')->URL;
|
||||
$formattedImage = $childData->getFormattedImage('AssetLibraryPreview');
|
||||
$thumbnail = $formattedImage ? $formattedImage->URL : '';
|
||||
|
||||
// Hmm this required the translated string to be appended to BottomRoot to add this to the Main tab
|
||||
$detailFormFields->addFieldToTab('BottomRoot.Main',
|
||||
@ -170,7 +171,8 @@ class AssetTableField extends ComplexTableField {
|
||||
|
||||
$tab->push(
|
||||
new LiteralField("ImageFull",
|
||||
"<img id='thumbnailImage' src='{$thumbnail}?r=" . rand(1,100000) . "' alt='{$childData->Name}' />" )
|
||||
"<img id='thumbnailImage' src='{$thumbnail}?r=" . rand(1,100000) . "' alt='{$childData->Name}' />"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user