mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
API CHANGE Made ComplexTableField not use Object::create() for item and popup classes to be consistent with TableListField. These can be overridden as itemClass and popupClass are public properties on ComplexTableField (from r98543)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102767 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
b4c425168c
commit
c652311ce9
@ -288,7 +288,7 @@ JS;
|
|||||||
|
|
||||||
$output = new DataObjectSet();
|
$output = new DataObjectSet();
|
||||||
foreach($this->sourceItems as $pageIndex=>$item) {
|
foreach($this->sourceItems as $pageIndex=>$item) {
|
||||||
$output->push(Object::create($this->itemClass,$item, $this));
|
$output->push(new $this->itemClass($item, $this));
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
@ -591,8 +591,7 @@ JS;
|
|||||||
$fields = $this->getFieldsFor($childData);
|
$fields = $this->getFieldsFor($childData);
|
||||||
$validator = $this->getValidatorFor($childData);
|
$validator = $this->getValidatorFor($childData);
|
||||||
|
|
||||||
$form = Object::create(
|
$form = new $this->popupClass(
|
||||||
$this->popupClass,
|
|
||||||
$this,
|
$this,
|
||||||
'AddForm',
|
'AddForm',
|
||||||
$fields,
|
$fields,
|
||||||
@ -787,10 +786,14 @@ class ComplexTableField_ItemRequest extends RequestHandler {
|
|||||||
$validator = $this->ctf->getValidatorFor($childData);
|
$validator = $this->ctf->getValidatorFor($childData);
|
||||||
$readonly = ($this->methodName == "show");
|
$readonly = ($this->methodName == "show");
|
||||||
|
|
||||||
$form = Object::create(
|
$form = new $this->ctf->popupClass(
|
||||||
$this->ctf->popupClass,
|
$this,
|
||||||
$this, "DetailForm",
|
"DetailForm",
|
||||||
$fields, $validator, $readonly, $childData);
|
$fields,
|
||||||
|
$validator,
|
||||||
|
$readonly,
|
||||||
|
$childData
|
||||||
|
);
|
||||||
|
|
||||||
$form->loadDataFrom($childData);
|
$form->loadDataFrom($childData);
|
||||||
if ($readonly) $form->makeReadonly();
|
if ($readonly) $form->makeReadonly();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user