Skip to content
Browse files

Fixed regression in SiteTree->getCMSActions()

Caused by toolbar recent changes
  • Loading branch information...
1 parent 1d470fe commit 74d63791b7c2068fe7278da5f010849c7fb5f3ec @chillu chillu committed Dec 14, 2012
Showing with 8 additions and 3 deletions.
  1. +5 −1 code/model/SiteTree.php
  2. +3 −2 tests/controller/CMSMainTest.php
View
6 code/model/SiteTree.php
@@ -2087,6 +2087,8 @@ public function getCMSActions() {
$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 @@ public function getCMSActions() {
$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;
}
/**
View
5 tests/controller/CMSMainTest.php
@@ -182,9 +182,10 @@ public function testCanPublishPageWithUnpublishedParentWithStrictHierarchyOff()
$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);

0 comments on commit 74d6379

Please sign in to comment.
Something went wrong with that request. Please try again.