From 32bf92f78df6acd70ad357d0852913b9dc69a678 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 20 Jun 2023 13:45:32 +0000 Subject: [PATCH] Bug 34067: Correct patron attributes 'starts with' search To test: 1 - Add a new searchable patron attribute type: Koha->Adminsitration->Patron attribute types 2 - Edit a patron and add a value 'alphabeta' for the attribute 3 - Go to 'Patrons', cick the settings icon in search and confirm search type is 'starts with' 4 - Type 'alpha' in the search bar, enter 5 - No patron found, wrong 6 - Type 'beta' in search bar, enter 7 - Patron found, wrong 8 - Apply patch 9 - Search for 'alpha', it finds the patron! 10 - Search for 'beta', patron not found 11 - Change search type to 'contains' 12 - Search for 'beta' 13 - Patron found! --- 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 ae95dfa909..a2da55dec9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -332,7 +332,7 @@ patterns.forEach(function(pattern,i){ let sub_or = []; sub_or.push({ - "extended_attributes.value": { "like": "%" + pattern + (search_type == "contain" ? "%" : "" )}, + "extended_attributes.value": { "like": (search_type == "contain" ? "%" : "" ) + pattern + "%" }, "extended_attributes.code": extended_attribute_types }); subquery_and.push(sub_or); -- 2.30.2