From 0aeb4708140d8031e76bbf149f0a09f015fd5eef Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 7 Apr 2022 14:25:08 +0200 Subject: [PATCH] Bug 30485: (bug 30063 follow-up) Display all patrons if not term passed Regression from bug 30063. If you are searching all patrons (not search term passed) from the header, the patron search result is not displayed. Test plan: Go to the Koha homepage, search patrons, don't enter a search term and click "submit" All patrons must be returned. Regression test: on the other patron search forms, confirm that there is no regression, ie. no patron displayed until you search for something Signed-off-by: Marcel de Rooy Signed-off-by: Fridolin Somers --- .../intranet-tmpl/prog/en/includes/patron-search.inc | 8 ++++---- members/member.pl | 2 +- members/members-home.pl | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) 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 87cd4c6201..de738dab2b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -249,10 +249,10 @@ var Sticky; var singleBranchMode = '[% singleBranchMode | html %]'; let logged_in_library_id = "[% Branches.GetLoggedInBranchcode | html %]"; - [% IF defer_loading %] - let defer_loading = 1; - [% ELSE %] + [% IF do_not_defer_loading %] let defer_loading = 0; + [% ELSE %] + let defer_loading = 1; [% END %] /* popstate event triggered by forward and back button. Need to refresh search */ @@ -670,7 +670,7 @@ $("#searchpattern").parent().hide(); }); - if ( !defer_loading && $("#search_patron_filter").val().length > 0 ) { + if ( !defer_loading ) { $("#patron_search_form").submit(); } diff --git a/members/member.pl b/members/member.pl index 2bd275cee5..54c3e81ac1 100755 --- a/members/member.pl +++ b/members/member.pl @@ -78,7 +78,7 @@ $template->param( searchtype => scalar $input->param('searchtype') || 'contain', searchfieldstype => $searchfieldstype, PatronsPerPage => C4::Context->preference("PatronsPerPage") || 20, - defer_loading => $defer_loading, + do_not_defer_loading => !$defer_loading, circsearch => $circsearch, attribute_type_codes => ( C4::Context->preference('ExtendedPatronAttributes') ? [ Koha::Patron::Attribute::Types->search( { staff_searchable => 1 } )->get_column('code') ] diff --git a/members/members-home.pl b/members/members-home.pl index b84bb47109..e3b903f463 100755 --- a/members/members-home.pl +++ b/members/members-home.pl @@ -76,7 +76,6 @@ $template->param( attribute_type_codes => ( C4::Context->preference('ExtendedPatronAttributes') ? [ Koha::Patron::Attribute::Types->search( { staff_searchable => 1 } )->get_column('code') ] : [] ), - defer_loading => 1, ); output_html_with_http_headers $query, $cookie, $template->output; -- 2.39.5