From 9ecb513205b43b1c5aab9090fedea8cce745d772 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. --- circ/circulation.pl | 2 -- .../prog/en/includes/member-search-box.inc | 11 +++++---- .../prog/en/includes/patron-search.inc | 24 ++++++++++--------- .../prog/en/modules/members/member.tt | 3 ++- members/member.pl | 1 - 5 files changed, 21 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 09d3a4e3a0..42543b2a1e 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 ) %]