mirror of
https://github.com/jonom/silverstripe-betternavigator.git
synced 2024-10-22 14:05:51 +02:00
Merge pull request #7 from jedateach/patch-1
Check if dataRecord is a SiteTree to prevent errors
This commit is contained in:
commit
3b53e7b36a
@ -26,7 +26,7 @@ class BetterNavigator extends DataExtension {
|
|||||||
$isDev = Director::isDev();
|
$isDev = Director::isDev();
|
||||||
|
|
||||||
if($isDev || Permission::check('CMS_ACCESS_CMSMain') || Permission::check('VIEW_DRAFT_CONTENT')) {
|
if($isDev || Permission::check('CMS_ACCESS_CMSMain') || Permission::check('VIEW_DRAFT_CONTENT')) {
|
||||||
if($this->owner && $this->owner->dataRecord) {
|
if($this->owner && $this->owner->dataRecord && $this->owner->dataRecord instanceof SiteTree) {
|
||||||
|
|
||||||
//Get SilverStripeNavigator links & stage info (CMS/Stage/Live/Archive)
|
//Get SilverStripeNavigator links & stage info (CMS/Stage/Live/Archive)
|
||||||
$nav = array();
|
$nav = array();
|
||||||
@ -61,4 +61,4 @@ class BetterNavigator extends DataExtension {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user