Skip to content

Commit

Permalink
MINOR Removed $params argument to DataObject->getCMSFields(), please …
Browse files Browse the repository at this point in the history
…use FormScaffolder directly (fixes #7135)
  • Loading branch information
chillu committed Apr 13, 2012
1 parent b127419 commit dc0168d
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions code/model/ErrorPage.php
Expand Up @@ -129,8 +129,8 @@ function requireDefaultRecords() {
}
}

function getCMSFields($params = null) {
$fields = parent::getCMSFields($params);
function getCMSFields() {
$fields = parent::getCMSFields();

$fields->addFieldToTab(
"Root.Main",
Expand Down
2 changes: 1 addition & 1 deletion code/model/RedirectorPage.php
Expand Up @@ -117,7 +117,7 @@ function onBeforeWrite() {
}
}

function getCMSFields($params = null) {
function getCMSFields() {
Requirements::javascript(CMS_DIR . '/javascript/RedirectorPage.js');

$fields = parent::getCMSFields();
Expand Down
2 changes: 1 addition & 1 deletion code/model/SiteConfig.php
Expand Up @@ -41,7 +41,7 @@ public static function disable_theme($theme) {
*
* @return FieldList
*/
function getCMSFields($params = null) {
function getCMSFields() {
Requirements::javascript(CMS_DIR . "/javascript/SitetreeAccess.js");

$groupsMap = DataList::create('Group')->map('ID', 'Breadcrumbs')->toArray();
Expand Down
2 changes: 1 addition & 1 deletion code/model/SiteTree.php
Expand Up @@ -1745,7 +1745,7 @@ function VirtualPages() {
*
* @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
Expand Down
4 changes: 2 additions & 2 deletions code/model/VirtualPage.php
Expand Up @@ -165,8 +165,8 @@ public function isPublishable() {
/**
* 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(
Expand Down
2 changes: 1 addition & 1 deletion code/widgets/Widget.php
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/controller/CMSMainTest.php
Expand Up @@ -114,7 +114,7 @@ function testThatGetCMSFieldsWorksOnEveryPageType() {
$page->flushCache();
$page = DataObject::get_by_id("SiteTree", $page->ID);

$this->assertTrue($page->getCMSFields(null) instanceof FieldList);
$this->assertTrue($page->getCMSFields() instanceof FieldList);
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/widgets/WidgetAreaEditorTest.php
Expand Up @@ -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;
Expand Down

0 comments on commit dc0168d

Please sign in to comment.