Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed empty string always on scaffolded enum fields

  • Loading branch information...
commit 8a7f9ede97caf9b8adaa0071d482b1917a42db1a 1 parent f365134
@icecaster icecaster authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 model/fieldtypes/Enum.php
View
6 model/fieldtypes/Enum.php
@@ -95,7 +95,9 @@ public function formField($title = null, $name = null, $hasEmpty = false, $value
if(!$name) $name = $this->name;
$field = new DropdownField($name, $title, $this->enumValues($hasEmpty), $value, $form);
- $field->setEmptyString($emptyString);
+ if($hasEmpty) {
+ $field->setEmptyString($emptyString);
+ }
return $field;
}
@@ -130,4 +132,4 @@ public function enumValues($hasEmpty = false) {
? array_merge(array('' => ''), ArrayLib::valuekey($this->enum))
: ArrayLib::valuekey($this->enum);
}
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.