From fd58becfca433f125df70531f9bece88c8f14b71 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sun, 23 Sep 2018 22:05:39 -0400 Subject: 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. --- app/class/form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/class') 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) { -- cgit v1.2.3