Merge pull request #739 from halkyon/x-cms-edit-errorpage

BUG Don't redirect to ErrorPage in CMS with x-cms-edit-link
This commit is contained in:
Sean Harvey 2013-05-13 15:54:01 -07:00
commit 46166408bf

View File

@ -1307,8 +1307,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
if($this->ExtraMeta) {
$tags .= $this->ExtraMeta . "\n";
}
if(Permission::check('CMS_ACCESS_CMSMain') && in_array('CMSPreviewable', class_implements($this))) {
if(Permission::check('CMS_ACCESS_CMSMain') && in_array('CMSPreviewable', class_implements($this)) && !$this instanceof ErrorPage) {
$tags .= "<meta name=\"x-page-id\" content=\"{$this->ID}\" />\n";
$tags .= "<meta name=\"x-cms-edit-link\" content=\"" . $this->CMSEditLink() . "\" />\n";
}