diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index 991f17c8..7f7bf33d 100644 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -2087,6 +2087,8 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid $moreOptions->push(FormAction::create('email', _t('CMSMain.EMAIL', 'Email'))); $moreOptions->push(FormAction::create('rollback', _t('CMSMain.ROLLBACK', 'Roll back to this version'))); + $actions = new FieldList(array($majorActions, $rootTabSet)); + // getCMSActions() can be extended with updateCMSActions() on a extension $this->extend('updateCMSActions', $actions); @@ -2162,11 +2164,13 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid $publish->addExtraClass('ss-ui-alternate'); } } + + $actions = new FieldList(array($majorActions, $rootTabSet)); // Hook for extensions to add/remove actions. $this->extend('updateCMSActions', $actions); - return new FieldList(array($majorActions, $rootTabSet)); + return $actions; } /** diff --git a/tests/controller/CMSMainTest.php b/tests/controller/CMSMainTest.php index f3d3ac78..877575b7 100644 --- a/tests/controller/CMSMainTest.php +++ b/tests/controller/CMSMainTest.php @@ -182,9 +182,10 @@ class CMSMainTest extends FunctionalTest { $parentPage->doUnpublish(); $childPage->doUnpublish(); - $this->assertContains( + $actions = $childPage->getCMSActions()->dataFields(); + $this->assertArrayHasKey( 'action_publish', - $childPage->getCMSActions()->column('Name'), + $actions, 'Can publish a page with an unpublished parent with strict hierarchy off' ); SiteTree::set_enforce_strict_hierarchy(false);