BUGFIX Fixed case where AssetAdmin would throw an error if $links was not an object in AssetAdmin::getCustomFieldsFor()

MINOR Defined $backlinks as an array before adding entries to it


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@114036 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-11-23 00:34:29 +00:00 committed by Sam Minnee
parent 75f12d5a7e
commit e907e2e266

View File

@ -200,7 +200,8 @@ class AssetTableField extends ComplexTableField {
$links = $childData->BackLinkTracking(); $links = $childData->BackLinkTracking();
if(class_exists('Subsite')) Subsite::disable_subsite_filter(false); if(class_exists('Subsite')) Subsite::disable_subsite_filter(false);
if($links->exists()) { if($links && $links->exists()) {
$backlinks = array();
foreach($links as $link) { foreach($links as $link) {
$backlinks[] = "<li><a href=\"admin/show/$link->ID\">" . $link->Breadcrumbs(null,true). "</a></li>"; $backlinks[] = "<li><a href=\"admin/show/$link->ID\">" . $link->Breadcrumbs(null,true). "</a></li>";
} }