Merge pull request #2845 from NightJar/pulls/4.12/undefined-index

FIX undefined index error in CMS
This commit is contained in:
Guy Sartorelli 2023-03-31 10:35:46 +13:00 committed by GitHub
commit 241fa3e06e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -739,13 +739,15 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
/**
* Generates a link to edit this page in the CMS.
*
* Implemented here to satisfy the CMSPreviewable interface, but data is intended to be loaded via Extension
*
* @see SilverStripe\Admin\CMSEditLinkExtension
*
* @return string
*/
public function CMSEditLink()
{
// This method has to be implemented here to satisfy the CMSPreviewable interface.
// See the actual implementation in CMSEditLinkExtension.
return $this->extend('CMSEditLink')[0];
return $this->extend('CMSEditLink')[0] ?? '';
}
/**