Skip to content

Commit

Permalink
Merge pull request #2845 from NightJar/pulls/4.12/undefined-index
Browse files Browse the repository at this point in the history
FIX undefined index error in CMS
  • Loading branch information
GuySartorelli authored Mar 30, 2023
2 parents 9907209 + e200364 commit 241fa3e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions code/Model/SiteTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -739,13 +739,15 @@ public function getAbsoluteLiveLink($includeStageEqualsLive = true)
/**
* 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] ?? '';
}

/**
Expand Down

0 comments on commit 241fa3e

Please sign in to comment.