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.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Pedro Amorim 2025-06-11 15:53:56 +00:00 committed by Lucas Gass
parent 082274d157
commit 227d1211fb
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 7 additions and 3 deletions

View File

@ -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);
});
});
}