ENHANCEMENT Adding ParentID and ClassName fields in LeftAndMain->getEditForm() if they're not already present. This ensures the UI can update state properly, e.g. to set the current tree element

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92836 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-11-21 03:20:30 +00:00
parent d732ee4c26
commit c44bc29a8f

View File

@ -757,6 +757,18 @@ JS;
);
}
// Add hidden fields which are required for saving the record
// and loading the UI state
if(!$fields->dataFieldByName('ClassName')) {
$fields->push(new HiddenField('ClassName'));
}
if(
Object::has_extension($this->stat('tree_class'), 'Hierarchy')
&& !$fields->dataFieldByName('ParentID')
) {
$fields->push(new HiddenField('ParentID'));
}
if($record->hasMethod('getAllCMSActions')) {
$actions = $record->getAllCMSActions();
} else {