mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
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.
This commit is contained in:
parent
ce81740718
commit
916309e6c6
@ -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'));
|
||||
|
Loading…
Reference in New Issue
Block a user