FIX use Injector for FormField::castedCopy

Allows LookupField to be replaced with user specificed classes.
This commit is contained in:
Will Rossiter 2018-10-24 12:11:57 +13:00
parent 022e0b971e
commit 66a404ad1a
2 changed files with 2 additions and 2 deletions

View File

@ -1424,7 +1424,7 @@ class FormField extends RequestHandler
$field = $classOrCopy;
if (!is_object($field)) {
$field = new $classOrCopy($this->name);
$field = $classOrCopy::create($this->name);
}
$field

View File

@ -17,7 +17,7 @@ class TreeDropdownField_Readonly extends TreeDropdownField
}
$source = [ $this->value => $title ];
$field = new LookupField($this->name, $this->title, $source);
$field = LookupField::create($this->name, $this->title, $source);
$field->setValue($this->value);
$field->setForm($this->form);
return $field->Field();