mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX use Injector for FormField::castedCopy
Allows LookupField to be replaced with user specificed classes.
This commit is contained in:
parent
022e0b971e
commit
66a404ad1a
@ -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
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user