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>
(cherry picked from commit f3333da496)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit dfbc6afe1b)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2023-01-05 09:23:45 +01:00 committed by Lucas Gass
parent 0b206ff709
commit e97e947efc

View file

@ -311,7 +311,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";