Skip to content

Commit

Permalink
Prevents notice error when parent page isn't set
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Gunn committed Mar 24, 2012
1 parent ecee3cc commit 4e9cbe0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/controllers/CMSMain.php
Expand Up @@ -264,7 +264,9 @@ public function SiteTreeHints() {
$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;

Expand Down

0 comments on commit 4e9cbe0

Please sign in to comment.