From 7a4ef4f6b006ff7b68275493ba0b5570fedd949e 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. --- 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 de4ba90c0de..9b394c93201 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.25.1