Fix Edit link not defined if no CMS access (#57)

In the situation that a user has draft site access but no CMS access they received a '$editLink not defined error'. This corrects that by defining it as false.
This commit is contained in:
Howard Grigg 2022-07-07 05:51:07 +12:00 committed by GitHub
parent f55bcdadd8
commit 92416eceef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -113,6 +113,7 @@ class BetterNavigatorExtension extends DataExtension
}
// Only show edit link if user has CMS access
$editLink = null;
if($isDev || Permission::check('CMS_ACCESS_CMSMain')) {
// Check for edit link override, e.g. for a DataObject
if(method_exists($this->owner, 'BetterNavigatorEditLink')) {