mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #8514 from wilr/pulls/lookup-injector
FIX use Injector for FormField::castedCopy
This commit is contained in:
commit
358cef0cdf
@ -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