mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
commit
fe496a29ec
@ -56,7 +56,7 @@ class DBBoolean extends DBField
|
|||||||
|
|
||||||
public function scaffoldFormField($title = null, $params = null)
|
public function scaffoldFormField($title = null, $params = null)
|
||||||
{
|
{
|
||||||
return new CheckboxField($this->name, $title);
|
return CheckboxField::create($this->name, $title);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scaffoldSearchField($title = null)
|
public function scaffoldSearchField($title = null)
|
||||||
|
@ -203,7 +203,7 @@ class DBHTMLText extends DBText
|
|||||||
|
|
||||||
public function scaffoldFormField($title = null, $params = null)
|
public function scaffoldFormField($title = null, $params = null)
|
||||||
{
|
{
|
||||||
return new HTMLEditorField($this->name, $title);
|
return HTMLEditorField::create($this->name, $title);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scaffoldSearchField($title = null)
|
public function scaffoldSearchField($title = null)
|
||||||
|
@ -58,7 +58,7 @@ class DBInt extends DBField
|
|||||||
|
|
||||||
public function scaffoldFormField($title = null, $params = null)
|
public function scaffoldFormField($title = null, $params = null)
|
||||||
{
|
{
|
||||||
return new NumericField($this->name, $title);
|
return NumericField::create($this->name, $title);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function nullValue()
|
public function nullValue()
|
||||||
|
@ -246,10 +246,10 @@ class DBText extends DBString
|
|||||||
{
|
{
|
||||||
if (!$this->nullifyEmpty) {
|
if (!$this->nullifyEmpty) {
|
||||||
// Allow the user to select if it's null instead of automatically assuming empty string is
|
// 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 {
|
} else {
|
||||||
// Automatically determine null (empty string)
|
// Automatically determine null (empty string)
|
||||||
return new TextareaField($this->name, $title);
|
return TextareaField::create($this->name, $title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ class DBYear extends DBField
|
|||||||
|
|
||||||
public function scaffoldFormField($title = null, $params = null)
|
public function scaffoldFormField($title = null, $params = null)
|
||||||
{
|
{
|
||||||
$selectBox = new DropdownField($this->name, $title);
|
$selectBox = DropdownField::create($this->name, $title);
|
||||||
$selectBox->setSource($this->getDefaultOptions());
|
$selectBox->setSource($this->getDefaultOptions());
|
||||||
return $selectBox;
|
return $selectBox;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user