CMSLink might not be set on RedirectorPage

This commit is contained in:
wernerkrauss 2018-03-26 14:42:19 +02:00 committed by GitHub
parent cd9c2083c8
commit 4d65ab4854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -52,8 +52,10 @@ class BetterNavigatorExtension extends DataExtension {
}
// Only show edit link if user has permission to edit this page
$editLink = false;
if ($this->owner->dataRecord->canEdit() && Permission::check('CMS_ACCESS_CMSMain') || $isDev) {
$editLink = $nav['CMSLink']['Link'];
if (($this->owner->dataRecord->canEdit() && Permission::check('CMS_ACCESS_CMSMain')) || $isDev) {
$editLink = array_key_exists('CMSLink', $nav)
? $nav['CMSLink']['Link']
: '';
}
// Is the logged in member nominated as a developer?