From 0db72614eb3628b66dbb343fa3fde64980e88403 Mon Sep 17 00:00:00 2001 From: jo Date: Sun, 8 Jan 2023 17:44:15 +0100 Subject: [PATCH] fix(legacy): advanced search by track type id Advanced where clause didn't support matching primary keys. Fixes #2344 --- legacy/application/models/Datatables.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/legacy/application/models/Datatables.php b/legacy/application/models/Datatables.php index bdd8d15b9..0bdc222d6 100644 --- a/legacy/application/models/Datatables.php +++ b/legacy/application/models/Datatables.php @@ -50,8 +50,13 @@ class Application_Model_Datatables } } else { if (trim($input1) !== '') { - $where['clause'][$dbname] = $dbname . ' ILIKE :' . $dbname . '1'; - $where['params'][$dbname . '1'] = '%' . $input1 . '%'; + if ($dbname == 'track_type_id') { + $where['clause'][$dbname] = $dbname . ' = :' . $dbname . '1'; + $where['params'][$dbname . '1'] = $input1; + } else { + $where['clause'][$dbname] = $dbname . ' ILIKE :' . $dbname . '1'; + $where['params'][$dbname . '1'] = '%' . $input1 . '%'; + } } } }