From db18f796b613653d44c5c1d572376d8eb86afa44 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 22 Apr 2008 19:34:12 +0000 Subject: [PATCH] r1621: Merging r1620 from trunk --- docs/changes.txt | 4 ++++ includes/functions.php | 10 +++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 19ea960..9ed3ca7 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -1,3 +1,7 @@ +1.2.3 +=============================== +- Fixed: Custom select field that is mandatory doesn't accept the first option as a valid entry (bug://report/121) + 1.2.2 =============================== - Fixed: A "Call-time pass-by-reference has been deprecated" on search.php diff --git a/includes/functions.php b/includes/functions.php index da654bc..06441db 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -392,6 +392,11 @@ function process_custom_fields(&$bugapi, &$msg, $errorbox = false, $searchMode = $bugapi->set($fieldname, intval($inputdata["$fieldname"])); continue; } + else if ($field['type'] == 'select_single') + { + $temp = unserialize($field['selects']); + $inputdata[$fieldname] = $temp[intval($inputdata["$fieldname"])] . ''; // make it a string so isset() doesn't catch + } // field data wasn't passed, so skip it if (!isset($inputdata["$fieldname"])) @@ -426,7 +431,7 @@ function process_custom_fields(&$bugapi, &$msg, $errorbox = false, $searchMode = } else { - if ($inputdata["$fieldname"] == -1) + if (empty($inputdata["$fieldname"])) { if (!$searchMode) { @@ -435,8 +440,7 @@ function process_custom_fields(&$bugapi, &$msg, $errorbox = false, $searchMode = continue; } - $temp = unserialize($field['selects']); - $bugapi->set($fieldname, trim($temp[ intval($inputdata["$fieldname"]) ]));; + $bugapi->set($fieldname, trim($inputdata["$fieldname"])); } } } -- 2.22.5