mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
MINOR Checking for existence of defaultParent in CMSMain->SiteTreeHints()
This commit is contained in:
parent
0d008b6496
commit
1914f0b29d
@ -250,7 +250,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
if($defaultChild != 'Page' && $defaultChild != null)
|
if($defaultChild != 'Page' && $defaultChild != null)
|
||||||
$def[$class]['defaultChild'] = $defaultChild;
|
$def[$class]['defaultChild'] = $defaultChild;
|
||||||
|
|
||||||
$id = SiteTree::get_by_link($obj->defaultParent())->ID;
|
$defaultParent = $obj->defaultParent();
|
||||||
|
$id = $defaultParent ? SiteTree::get_by_link($defaultParent)->ID : null;
|
||||||
$defaultParent = $id ? SiteTree::get_by_link($obj->defaultParent())->ID : null;
|
$defaultParent = $id ? SiteTree::get_by_link($obj->defaultParent())->ID : null;
|
||||||
|
|
||||||
if ($defaultParent != 1 && $defaultParent != null) $def[$class]['defaultParent'] = $defaultParent;
|
if ($defaultParent != 1 && $defaultParent != null) $def[$class]['defaultParent'] = $defaultParent;
|
||||||
|
Loading…
Reference in New Issue
Block a user