From f6394501f2ae6468cef8279ba8e296427cb69188 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 30 Mar 2022 13:02:07 +0200 Subject: [PATCH] Bug 30063: Restore back behaviour MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Séverine Queune Signed-off-by: Martin Renvoize Signed-off-by: Fridolin Somers --- koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc | 5 +++-- members/member.pl | 4 ++-- members/members-home.pl | 1 + 3 files changed, 6 insertions(+), 4 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 514ced47b1..b8d479e15d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -249,6 +249,7 @@ var Sticky; var singleBranchMode = '[% singleBranchMode | html %]'; let logged_in_library_id = "[% Branches.GetLoggedInBranchcode | html %]"; + let defer_loading = [% defer_loading ? 1 : 0 %]; /* popstate event triggered by forward and back button. Need to refresh search */ window.addEventListener('popstate', (event) => { @@ -368,7 +369,7 @@ [% END %] }, [% END %] - "iDeferLoading": 0, + "iDeferLoading": defer_loading, "columns": [ [% FOR column IN columns %] [% IF default_sort_column == column %] @@ -665,7 +666,7 @@ $("#searchpattern").parent().hide(); }); - if ( $("#search_patron_filter").val().length > 0 ) { + if ( !defer_loading && $("#search_patron_filter").val().length > 0 ) { $("#patron_search_form").submit(); } diff --git a/members/member.pl b/members/member.pl index bd85a3b613..2bd275cee5 100755 --- a/members/member.pl +++ b/members/member.pl @@ -68,7 +68,7 @@ my $searchfieldstype = $input->param('searchfieldstype') || 'standard'; $template->param( 'alphabet' => C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' ); -my $view = $input->request_method() eq "GET" && !$circsearch ? "show_form" : "show_results"; +my $defer_loading = $input->request_method() eq "GET" && !$circsearch ? 1 : 0; $template->param( patron_lists => [ GetPatronLists() ], @@ -78,7 +78,7 @@ $template->param( searchtype => scalar $input->param('searchtype') || 'contain', searchfieldstype => $searchfieldstype, PatronsPerPage => C4::Context->preference("PatronsPerPage") || 20, - view => $view, + 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 e3b903f463..b84bb47109 100755 --- a/members/members-home.pl +++ b/members/members-home.pl @@ -76,6 +76,7 @@ $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