mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00: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;
|
$field = $classOrCopy;
|
||||||
|
|
||||||
if (!is_object($field)) {
|
if (!is_object($field)) {
|
||||||
$field = new $classOrCopy($this->name);
|
$field = $classOrCopy::create($this->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
$field
|
$field
|
||||||
|
@ -17,7 +17,7 @@ class TreeDropdownField_Readonly extends TreeDropdownField
|
|||||||
}
|
}
|
||||||
|
|
||||||
$source = [ $this->value => $title ];
|
$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->setValue($this->value);
|
||||||
$field->setForm($this->form);
|
$field->setForm($this->form);
|
||||||
return $field->Field();
|
return $field->Field();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user