Permalink
Browse files

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.
  • Loading branch information...
1 parent ce81740 commit 916309e6c66a55fda6b8f0332e6db4f5d0489af3 @frankmullenger frankmullenger committed Oct 8, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 code/model/SiteTree.php
View
@@ -2045,7 +2045,7 @@ function getCMSActions() {
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'));

0 comments on commit 916309e

Please sign in to comment.