diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index 9ed8c73d..5ab2ae6c 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -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;