From 2f3e1cd76b38452da0d23c46d33e44d49b7adea0 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 22 Jun 2023 15:37:55 +0100 Subject: [PATCH] Bug 34094: Use DefaultPatronSearchMethod consistently This patch updates the patron search bar and pages to default search method to that defined by DefaultPatronSearchMethod system preference. Test plan 1) Prior to this patch confirm that regardless of what you set DefaultPatronSearchMethod to, the search in /members/member.pl, members/members-home.pl and the search from the patrons search top bar all default to 'contains'. 2) Apply the patch 3) Confirm that the system preference now affects the default option for match type upon page load. Signed-off-by: Sam Lau Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi (cherry picked from commit b804313c20462fce7648570a4619b7b212765262) Signed-off-by: Martin Renvoize --- circ/circulation.pl | 2 -- .../prog/en/includes/member-search-box.inc | 11 +++++---- .../prog/en/includes/patron-search.inc | 23 ++++++++++--------- .../prog/en/modules/members/member.tt | 3 ++- members/member.pl | 1 - 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 7b35a8c860..9b925e29ad 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -150,8 +150,6 @@ my @failedreturns = $query->multi_param('failedreturn'); our %return_failed = (); for (@failedreturns) { $return_failed{$_} = 1; } -my $searchtype = $query->param('searchtype') || q{contain}; - my $branch = C4::Context->userenv->{'branch'}; for my $barcode ( @$barcodes ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc index d1f21673ba..2655e4162d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-search-box.inc @@ -4,6 +4,7 @@ [% USE Koha %] [% PROCESS 'patronfields.inc' %] [% IF CAN_user_borrowers_edit_borrowers %] + [%- SET searchtype = Koha.Preference('DefaultPatronSearchMethod') -%] [% IF( bs_tab_active ) %]