Merge pull request #8514 from wilr/pulls/lookup-injector

FIX use Injector for FormField::castedCopy
This commit is contained in:
Robbie Averill 2018-11-07 19:20:36 +02:00 committed by GitHub
commit 358cef0cdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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();