From dc0168d01b03679ff128fc1449a9cea3a70c9c21 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 13 Apr 2012 15:55:32 +0200 Subject: [PATCH] MINOR Removed $params argument to DataObject->getCMSFields(), please use FormScaffolder directly (fixes #7135) --- code/model/ErrorPage.php | 4 ++-- code/model/RedirectorPage.php | 2 +- code/model/SiteConfig.php | 2 +- code/model/SiteTree.php | 2 +- code/model/VirtualPage.php | 4 ++-- code/widgets/Widget.php | 2 +- tests/controller/CMSMainTest.php | 2 +- tests/widgets/WidgetAreaEditorTest.php | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/code/model/ErrorPage.php b/code/model/ErrorPage.php index d8973b92..bb259c83 100644 --- a/code/model/ErrorPage.php +++ b/code/model/ErrorPage.php @@ -129,8 +129,8 @@ class ErrorPage extends Page { } } - function getCMSFields($params = null) { - $fields = parent::getCMSFields($params); + function getCMSFields() { + $fields = parent::getCMSFields(); $fields->addFieldToTab( "Root.Main", diff --git a/code/model/RedirectorPage.php b/code/model/RedirectorPage.php index d88f7ef0..8cfcdd61 100644 --- a/code/model/RedirectorPage.php +++ b/code/model/RedirectorPage.php @@ -117,7 +117,7 @@ class RedirectorPage extends Page { } } - function getCMSFields($params = null) { + function getCMSFields() { Requirements::javascript(CMS_DIR . '/javascript/RedirectorPage.js'); $fields = parent::getCMSFields(); diff --git a/code/model/SiteConfig.php b/code/model/SiteConfig.php index 0a9d2d12..13ed33c7 100644 --- a/code/model/SiteConfig.php +++ b/code/model/SiteConfig.php @@ -41,7 +41,7 @@ class SiteConfig extends DataObject implements PermissionProvider { * * @return FieldList */ - function getCMSFields($params = null) { + function getCMSFields() { Requirements::javascript(CMS_DIR . "/javascript/SitetreeAccess.js"); $groupsMap = DataList::create('Group')->map('ID', 'Breadcrumbs')->toArray(); diff --git a/code/model/SiteTree.php b/code/model/SiteTree.php index 6a6862c9..3ec577de 100644 --- a/code/model/SiteTree.php +++ b/code/model/SiteTree.php @@ -1745,7 +1745,7 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid * * @return FieldList The fields to be displayed in the CMS. */ - function getCMSFields($params = null) { + function getCMSFields() { require_once("forms/Form.php"); // Status / message // Create a status message for multiple parents diff --git a/code/model/VirtualPage.php b/code/model/VirtualPage.php index f97053fa..aae4c9a6 100644 --- a/code/model/VirtualPage.php +++ b/code/model/VirtualPage.php @@ -165,8 +165,8 @@ class VirtualPage extends Page { /** * Generate the CMS fields from the fields from the original page. */ - function getCMSFields($cms = null) { - $fields = parent::getCMSFields($cms); + function getCMSFields() { + $fields = parent::getCMSFields(); // Setup the linking to the original page. $copyContentFromField = new TreeDropdownField( diff --git a/code/widgets/Widget.php b/code/widgets/Widget.php index 0a234348..b2417d80 100644 --- a/code/widgets/Widget.php +++ b/code/widgets/Widget.php @@ -34,7 +34,7 @@ class Widget extends DataObject { static $cmsTitle = "Name of this widget"; static $description = "Description of what this widget does."; - function getCMSFields($params = null) { + function getCMSFields() { $fields = new FieldList(); $this->extend('updateCMSFields', $fields); return $fields; diff --git a/tests/controller/CMSMainTest.php b/tests/controller/CMSMainTest.php index 312fbbb3..9d4b7ee2 100644 --- a/tests/controller/CMSMainTest.php +++ b/tests/controller/CMSMainTest.php @@ -114,7 +114,7 @@ class CMSMainTest extends FunctionalTest { $page->flushCache(); $page = DataObject::get_by_id("SiteTree", $page->ID); - $this->assertTrue($page->getCMSFields(null) instanceof FieldList); + $this->assertTrue($page->getCMSFields() instanceof FieldList); } } diff --git a/tests/widgets/WidgetAreaEditorTest.php b/tests/widgets/WidgetAreaEditorTest.php index 81eb76b5..5a32536d 100644 --- a/tests/widgets/WidgetAreaEditorTest.php +++ b/tests/widgets/WidgetAreaEditorTest.php @@ -460,7 +460,7 @@ class WidgetAreaEditorTest_TestWidget extends Widget implements TestOnly { static $db = array( 'Title' => 'Varchar' ); - public function getCMSFields($params = null) { + public function getCMSFields() { $fields = new FieldList(); $fields->push(new TextField('Title')); return $fields;