Summary: | Patron search to find patrons with hyphens when they haven't been added in the search | ||
---|---|---|---|
Product: | Koha | Reporter: | Wainui Witika-Park <wainuiwitikapark> |
Component: | Patrons | Assignee: | Bugs List <koha-bugs> |
Status: | NEW --- | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | didier.gautheron, gmcharlt, jonathan.druart, kyle.m.hall, wainuiwitikapark |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 32772 | ||
Bug Blocks: |
Description
Wainui Witika-Park
2023-09-28 01:37:01 UTC
And searching for "le bon" doesn't work anymore too since moving to rest API for search. Hi Wainui, please try this change: diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index 86792041afe..6bdee1f0723 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -555,7 +555,7 @@ function buildPatronSearchQuery(term, options) { let q = []; let leading_wildcard; let search_fields; - let patterns = term.split(/[\s,]+/).filter(function (s) { return s.length }); + let patterns = term.split(/[\s,-]+/).filter(function (s) { return s.length }); // Bail if no patterns if (patterns.length == 0) { (In reply to Didier Gautheron from comment #1) > And searching for "le bon" doesn't work anymore too since moving to rest API > for search. Please provide more info. Splitting on spaces should work. Hi, before if there's a composed name like "foo-bar" searching "foo-bar" or "foo bar" worked, now "foo bar" doesn't work. Sorry, the diff on comment #2 won't address the problem. Didier, I think what you describe is exactly what Wainui described on comment 0. If you want to work you need to select "Search type: contains". I am not sure it is a regression since the move to the REST API, we already had this start with/contains options. Hi, Yes it's fixed by using the new syspref DefaultPatronSearchMethod. |