Skip to content

Loading…

[2011-10-07] Returning false from canDeleteFromLive() does not remove 'Unpublish' button #332

Closed
silverstripe-issues opened this Issue · 4 comments

3 participants

@silverstripe-issues

created by: @frankmullenger (frankmullenger)
assigned to: @chillu (ischommer)
created at: 2011-10-07
original ticket: http://open.silverstripe.org/ticket/6731


Returning false from canDeleteFromLive() does not remove 'Unpublish' button from the CMS. The Unpublish button will return an error if pressed in the CMS still though.

Possible patch in SiteTree->getCMSActions()

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'));
            $unpublish->addExtraClass('delete');
            $actions->push($unpublish);
        }
@chillu chillu was assigned
@silverstripe-issues

comment by: @frankmullenger (frankmullenger)
created at: 2011-10-08


Fixed with:

frankmullenger@916309e.

Pull request:

#30

@silverstripe-issues

comment by: @chillu (ischommer)
created at: 2011-10-10


Thanks Frank! Lets leave the ticket open until its merged, aye?

@silverstripe-issues

comment by: @frankmullenger (frankmullenger)
created at: 2011-10-10


Oh ok, reopened.

@simonwelsh

Has been merged.

@simonwelsh simonwelsh closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.