From 54599b98d11fae2870bce951d87fd64826578bfe Mon Sep 17 00:00:00 2001 From: UndefinedOffset Date: Wed, 1 Apr 2015 11:54:13 -0300 Subject: [PATCH] BUGFIX: Fixed issue where Widget::CMSEditor() can't see the enabled checkbox --- code/model/Widget.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/code/model/Widget.php b/code/model/Widget.php index 7eaad5c..a1444f4 100644 --- a/code/model/Widget.php +++ b/code/model/Widget.php @@ -159,10 +159,18 @@ class Widget extends DataObject { * @return FieldList */ public function getCMSFields() { - $fields = parent::getCMSFields(); + $fields = $this->scaffoldFormFields(array( + // Don't allow has_many/many_many relationship editing before the record is first saved + 'includeRelations' => ($this->ID > 0), + 'tabbed' => false, + 'ajaxSafe' => true + )); + $fields->removeByName('ParentID'); $fields->removeByName('Sort'); + $this->extend('updateCMSFields', $tabbedFields); + return $fields; }