From c3aa34ffc1de8ffdb80d84d2073af09282ebd072 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 8 Jun 2005 23:18:12 +0000 Subject: [PATCH] r254: Searching of custom fields now works again --- search.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/search.php b/search.php index d0a8f33..fff5862 100644 --- a/search.php +++ b/search.php @@ -183,20 +183,20 @@ if ($_REQUEST['do'] == 'results') ); while ($field = $bugsys->db->fetch_array($fields_fetch)) { - if (!empty($bugsys->in['custom']["$field[shortname]"]) OR $field['type'] == 'select_single') + if (!empty($bugsys->in['custom']["$field[fieldid]"]) OR $field['type'] == 'select_single') { if ($field['type'] == 'input_checkbox') { - $querybuild[] = "AND bugfieldvalue.$field[shortname] = " . (($bugsys->in['custom']["$field[shortname]"] == 1) ? 0 : 1); + $querybuild[] = "AND bugfieldvalue.field$field[fieldid] = " . (($bugsys->in['custom']["$field[fieldid]"] == 1) ? 0 : 1); } else if ($field['type'] == 'input_text') { - $querybuild[] = "AND bugfieldvalue.$field[shortname] LIKE '%" . $bugsys->in['custom']["$field[shortname]"] . "%'"; + $querybuild[] = "AND bugfieldvalue.field$field[fieldid] LIKE '%" . $bugsys->in['custom']["$field[fieldid]"] . "%'"; } - else if ($field['type'] == 'select_single' AND $bugsys->in['custom']["$field[shortname]"] != -1) + else if ($field['type'] == 'select_single' AND $bugsys->in['custom']["$field[fieldid]"] != -1) { $temp = unserialize($field['selects']); - $querybuild[] = "AND bugfieldvalue.$field[shortname] = '" . trim($temp[ intval($bugsys->in['custom']["$field[shortname]"]) ]) . "'"; + $querybuild[] = "AND bugfieldvalue.field$field[fieldid] = '" . trim($temp[ intval($bugsys->in['custom']["$field[fieldid]"]) ]) . "'"; } } } -- 2.43.5