From f3333da49675daca9fc9d2147d31a446d20ac8ef Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 5 Jan 2023 09:23:45 +0100 Subject: [PATCH] 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 Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc index de4ba90c0d..9b394c9320 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -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"; -- 2.39.5