Bug 32491: Split patron search terms on comma

Previous behaviour allowed search 'surname, firstname'. We should remove
the comma from the search terms.

Test plan:
On the main patron search, search for "surname, firstname" and confirm
that with this patch applied the search returns the expected results.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-01-05 09:23:45 +01:00 committed by Tomas Cohen Arazi
parent cc58ca2a3c
commit f3333da496
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 1 additions and 1 deletions

View File

@ -314,7 +314,7 @@
"-and": function(){
let pattern = $("#search_patron_filter").val();
if (!pattern) return "";
let patterns = pattern.split(' ').filter(function(s){ return s.length });
let patterns = pattern.split(/[\s,]+/).filter(function(s){ return s.length });
let filters = [];
let search_type = $("#searchtype_filter").val() || "contain";