mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Fixed Text::scaffoldFormField() showing a "Is Null" checkbox, even if nullifyEmpty is true
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@90747 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
8216448da3
commit
adf9bc89fe
@ -309,10 +309,11 @@ class Text extends StringField {
|
|||||||
* @see DBField::scaffoldFormField()
|
* @see DBField::scaffoldFormField()
|
||||||
*/
|
*/
|
||||||
public function scaffoldFormField($title = null, $params = null) {
|
public function scaffoldFormField($title = null, $params = null) {
|
||||||
if($this->nullifyEmpty) {
|
if(!$this->nullifyEmpty) {
|
||||||
// We can have an empty field so we need to let the user specifically set null value in the field.
|
// 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 new NullableField(new TextareaField($this->name, $title));
|
||||||
} else {
|
} else {
|
||||||
|
// Automatically determine null (empty string)
|
||||||
return new TextareaField($this->name, $title);
|
return new TextareaField($this->name, $title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -81,9 +81,10 @@ class Varchar extends StringField {
|
|||||||
*/
|
*/
|
||||||
public function scaffoldFormField($title = null, $params = null) {
|
public function scaffoldFormField($title = null, $params = null) {
|
||||||
if(!$this->nullifyEmpty) {
|
if(!$this->nullifyEmpty) {
|
||||||
// We can have an empty field so we need to let the user specifically set null value in the field.
|
// Allow the user to select if it's null instead of automatically assuming empty string is
|
||||||
return new NullableField(new TextField($this->name, $title));
|
return new NullableField(new TextField($this->name, $title));
|
||||||
} else {
|
} else {
|
||||||
|
// Automatically determine null (empty string)
|
||||||
return parent::scaffoldFormField($title);
|
return parent::scaffoldFormField($title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user