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

Closed
silverstripe-issues opened this Issue Apr 3, 2013 · 4 comments

Comments

Projects
None yet
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);
        }

@ghost ghost assigned chillu Apr 3, 2013

@silverstripe-issues

This comment has been minimized.

Show comment
Hide comment
@silverstripe-issues

silverstripe-issues Apr 3, 2013

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


Fixed with:

frankmullenger/silverstripe-cms@916309e.

Pull request:

#30

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


Fixed with:

frankmullenger/silverstripe-cms@916309e.

Pull request:

#30

@silverstripe-issues

This comment has been minimized.

Show comment
Hide comment
@silverstripe-issues

silverstripe-issues Apr 3, 2013

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


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

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


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

@silverstripe-issues

This comment has been minimized.

Show comment
Hide comment
@silverstripe-issues

silverstripe-issues Apr 3, 2013

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


Oh ok, reopened.

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


Oh ok, reopened.

@simonwelsh

This comment has been minimized.

Show comment
Hide comment
@simonwelsh

simonwelsh Mar 16, 2014

Contributor

Has been merged.

Contributor

simonwelsh commented Mar 16, 2014

Has been merged.

@simonwelsh simonwelsh closed this Mar 16, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment