mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Fixed bugs with #1403 changes made in r62218.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62268 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
c9f5e1ef58
commit
5393392c48
@ -149,16 +149,13 @@ class CompositeField extends FormField {
|
||||
* Add a new child field to the end of the set.
|
||||
*/
|
||||
public function push(FormField $field) {
|
||||
//$this->rootFieldSet()->removeByName($field->Name());
|
||||
$this->children->push($field);
|
||||
}
|
||||
public function insertBefore($field, $insertBefore) {
|
||||
//$this->rootFieldSet()->removeByName($field->Name());
|
||||
return $this->children->insertBefore($field, $insertBefore);
|
||||
}
|
||||
|
||||
public function insertBeforeRecursive($field, $insertBefore, $level = 0) {
|
||||
//$this->rootFieldSet()->removeByName($field->Name());
|
||||
return $this->children->insertBeforeRecursive($field, $insertBefore, $level+1);
|
||||
}
|
||||
public function removeByName($fieldName) {
|
||||
@ -169,6 +166,11 @@ class CompositeField extends FormField {
|
||||
return $this->children->replaceField($fieldName, $newField);
|
||||
}
|
||||
|
||||
function rootFieldSet() {
|
||||
if(is_object($this->containerFieldSet)) return $this->containerFieldSet->rootFieldSet();
|
||||
else return $this->children;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a readonly version of this field. Keeps the composition but returns readonly
|
||||
* versions of all the children
|
||||
|
@ -531,7 +531,6 @@ HTML;
|
||||
}
|
||||
|
||||
function rootFieldSet() {
|
||||
return $this->containerFieldSet->rootFieldSet();
|
||||
if(is_object($this->containerFieldSet)) return $this->containerFieldSet->rootFieldSet();
|
||||
else user_error("rootFieldSet() called on $this->class object without a containerFieldSet", E_USER_ERROR);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user