summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2018-09-23 22:05:39 -0400
committerMalf Furious <m@lfurio.us>2018-09-23 22:05:39 -0400
commitfd58becfca433f125df70531f9bece88c8f14b71 (patch)
tree3d453941b267bcd1579f1ee29d30e35b95c48436
parentd9b75f4f38bb258893896443bdfb3a3e43773d47 (diff)
downloadscrott-fd58becfca433f125df70531f9bece88c8f14b71.tar.gz
scrott-fd58becfca433f125df70531f9bece88c8f14b71.zip
form: Fix bug in populate()
There was a problem with processing enum type fields. The way all other field types are asserted to be 'defined' is via: isset($field) && $field != "" Which works perfectly fine, and is exactly what we want. However, with enums the second part of that && can bite us if "" is in the list of acceptable values. This commit removed that half of the check (only for enum values) so that the empty string may be an acceptable enum value. If "" is not in the values array, then the check is implicitly reinstated.
-rw-r--r--app/class/form.class.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/class/form.class.php b/app/class/form.class.php
index 8f9d936..10a68c3 100644
--- a/app/class/form.class.php
+++ b/app/class/form.class.php
@@ -154,7 +154,7 @@ class form
/* init enum fields */
foreach ($this->enumFields as $field)
{
- if (isset($input[$field['name']]) && $input[$field['name']] != "")
+ if (isset($input[$field['name']]))
{
if (array_search($input[$field['name']], $field['values']) === false)
{