From dddbbaf4cec15d0021256e19bd6b32d17d38291d Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Wed, 11 Jun 2025 15:53:56 +0000 Subject: [PATCH] Bug 40122: Dont attempt regex search for select dropdowns Test plan: 1) Place a hold (next available) to biblio 76 and 437: http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=76 http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=437 2) Edit 'Centerville' library name to 'Centerville (CPL)' 3) Visit the 'holds to pull' page: http://localhost:8081/cgi-bin/koha/circ/pendingreserves.pl 4) Try to filter for 'Centerville (CPL)'. Notice the filtering returns nothing. 5) Apply patches. Repeat test plan. Notice 'Centerville (CPL)' filtering now works. --- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index 8149806db99..bdfe317ddaa 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -1128,8 +1128,12 @@ function _dt_add_delay_filters(table_dt, table_node) { let col_input_search = DataTable.util.debounce(function (i, val) { table_dt.column(i).search(val).draw(); }, delay_ms); - let col_select_search = DataTable.util.debounce(function (i, val) { - table_dt.column(i).search(val, true, false).draw(); + let col_select_search = DataTable.util.debounce(function ( + i, + val, + regex_search = true + ) { + table_dt.column(i).search(val, regex_search, false).draw(); }, delay_ms); $(table_node) @@ -1148,7 +1152,7 @@ function _dt_add_delay_filters(table_dt, table_node) { .find("select") .unbind() .bind("keyup change", function () { - col_select_search(i, this.value); + col_select_search(i, this.value, false); }); }); } -- 2.39.5