Bug 40002: Fix filtering of patrons by 'Browse by last name'

We cannot longer filter patrons by first letter, the browser errors
"Uncaught TypeError: v.replace is not a function"

Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit ea359a10a9)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 61f9a253e4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Jonathan Druart 2025-05-27 10:07:12 +02:00 committed by Fridolin Somers
parent 889c45effe
commit 2ca099d72c
No known key found for this signature in database
GPG Key ID: 9A8E73E2A8B96537
1 changed files with 7 additions and 3 deletions

View File

@ -606,9 +606,13 @@ function _dt_default_ajax (params){
} else if ( f == '-and' ) {
if (v) and_query_parameters.push(v)
} else if ( v ) {
additional_filters[k] = v
.replace(/^\^/, "")
.replace(/\$$/, "");
if (typeof v === "string") {
additional_filters[k] = v
.replace(/^\^/, "")
.replace(/\$$/, "");
} else {
additional_filters[k] = v;
}
}
}
if ( Object.keys(additional_filters).length ) {