From 916309e6c66a55fda6b8f0332e6db4f5d0489af3 Mon Sep 17 00:00:00 2001 From: Frank Mullenger Date: Sat, 8 Oct 2011 17:14:54 +1300 Subject: [PATCH] BUGFIX returning false from canDeleteFromLive() for a DataObject did not remove the Unpublish button from CMS, but the Unpublish action returned an error. Fixes #6731. --- code/model/SiteTree.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index 1a636f9a..970cf0a6 100644 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -2045,7 +2045,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid return $actions; } - if($this->isPublished() && $this->canPublish() && !$this->IsDeletedFromStage) { + if($this->isPublished() && $this->canPublish() && !$this->IsDeletedFromStage && $this->canDeleteFromLive()) { // "unpublish" $unpublish = FormAction::create('unpublish', _t('SiteTree.BUTTONUNPUBLISH', 'Unpublish'), 'delete'); $unpublish->describe(_t('SiteTree.BUTTONUNPUBLISHDESC', 'Remove this page from the published site'));