Merge pull request #85 from webbuilders-group/1.0

BUGFIX: Fixed issue where Widget::CMSEditor() can't rename the enabled checkbox
This commit is contained in:
Will Rossiter 2015-04-02 14:45:59 +13:00
commit 557a7219f4
1 changed files with 9 additions and 1 deletions

View File

@ -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;
}