mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Prevents notice error when parent page isn't set
This commit is contained in:
parent
ecee3cc772
commit
4e9cbe0771
@ -264,7 +264,9 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
$def[$class]['defaultChild'] = $defaultChild;
|
||||
|
||||
$defaultParent = $obj->defaultParent();
|
||||
$id = $defaultParent ? SiteTree::get_by_link($defaultParent)->ID : null;
|
||||
$parent = SiteTree::get_by_link($defaultParent);
|
||||
|
||||
$id = $parent ? $parent->id : null;
|
||||
|
||||
if ($defaultParent != 1 && $defaultParent != null) $def[$class]['defaultParent'] = $defaultParent;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user