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>
This commit is contained in:
Jonathan Druart 2025-05-27 10:07:12 +02:00 committed by Paul Derscheid
parent ae5fde9586
commit 61f9a253e4
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 7 additions and 3 deletions

View File

@ -714,9 +714,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) {