From dddf051a6f402b89d912047dc2061763738037a3 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 10 Aug 2023 18:58:55 +0000 Subject: [PATCH] Bug 33428: Parse search fields in buildPatronSearchQuery This patch moves the parsing of standard search_field into the buildPatronQuery subroutine and adds a check for 'standard' field before adding attributes to the search To test: 1 - Add a new attribute type and make it searchable 2 - Add a value to a patron 3 - Search for this value using 'Standard' fields, confirm you get the patron 4 - Search for the value using 'Cardnumber' field, confirm you get the patron - BAD! 5 - Apply patch 6 - Repeat cardnumebr search, confirm patron not found - Yay! 7 - Search standard, confirm patron is found 8 - Add a new field to 'DefaultPatronSearchFields 9 - Confirm it appears in patron search dropdown 10 - Confirm a search of this field with the attribute value does not return the patron Signed-off-by: Fridolin Somers Signed-off-by: Martin Renvoize --- .../prog/en/includes/patronfields.inc | 14 +++++------ .../intranet-tmpl/prog/js/staff-global.js | 23 +++++++++++++++++-- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc index 03e6d49022..777cc300bd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patronfields.inc @@ -1,9 +1,9 @@ [%- BLOCK patron_fields -%] [%- SWITCH name -%] - [%- CASE standard -%]Standard - [%- CASE full_address -%]Full address - [%- CASE all_emails -%]All emails - [%- CASE all_phones -%]All phones + [%- CASE 'standard' -%]Standard + [%- CASE 'full_address' -%]Full address + [%- CASE 'all_emails' -%]All emails + [%- CASE 'all_phones' -%]All phones [%- CASE 'borrowernumber' -%]Borrowernumber [%- CASE 'cardnumber' -%]Card number [%- CASE 'surname' -%]Surname @@ -87,10 +87,8 @@