Merge pull request #9397 from mikenuguid/bugfix/update-orm-scaffoldformfield

FIX Update ORM DBField types to use Injector in scaffoldFormField()
This commit is contained in:
Robbie Averill 2020-02-04 22:38:34 +13:00 committed by GitHub
commit fe496a29ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 6 deletions

View File

@ -56,7 +56,7 @@ class DBBoolean extends DBField
public function scaffoldFormField($title = null, $params = null)
{
return new CheckboxField($this->name, $title);
return CheckboxField::create($this->name, $title);
}
public function scaffoldSearchField($title = null)

View File

@ -203,7 +203,7 @@ class DBHTMLText extends DBText
public function scaffoldFormField($title = null, $params = null)
{
return new HTMLEditorField($this->name, $title);
return HTMLEditorField::create($this->name, $title);
}
public function scaffoldSearchField($title = null)

View File

@ -58,7 +58,7 @@ class DBInt extends DBField
public function scaffoldFormField($title = null, $params = null)
{
return new NumericField($this->name, $title);
return NumericField::create($this->name, $title);
}
public function nullValue()

View File

@ -246,10 +246,10 @@ class DBText extends DBString
{
if (!$this->nullifyEmpty) {
// Allow the user to select if it's null instead of automatically assuming empty string is
return new NullableField(new TextareaField($this->name, $title));
return NullableField::create(TextareaField::create($this->name, $title));
} else {
// Automatically determine null (empty string)
return new TextareaField($this->name, $title);
return TextareaField::create($this->name, $title);
}
}

View File

@ -20,7 +20,7 @@ class DBYear extends DBField
public function scaffoldFormField($title = null, $params = null)
{
$selectBox = new DropdownField($this->name, $title);
$selectBox = DropdownField::create($this->name, $title);
$selectBox->setSource($this->getDefaultOptions());
return $selectBox;
}