From e77ca95756919ab1630a35b1c69e0fdc41289f27 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Mon, 14 Feb 2022 18:38:16 +0000 Subject: [PATCH] Bug 30098: Only redirect from patron search if single result is on first page MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch simply adds a check that we are oin the first page (starting at result 0) before redirecting to a isngle patron To test: 1 - Perform a patron search that returns 41 results, on Koha testing docker, 'a' works 2 - Go to second page of results, works 3 - Go to third page of results, redirected to the patron 4 - Apply patch 5 - Repeat search and paging 6 - On third page you remian in results and are not redirected to patron Signed-off-by: Emmanuel Bétemps Signed-off-by: Martin Renvoize Signed-off-by: Fridolin Somers Signed-off-by: Kyle M Hall --- koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt index b7ef036f21..5c779cc6b0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt @@ -440,7 +440,7 @@ 'data': aoData, 'success': function(json){ // redirect if there is only 1 result. - if ( json.aaData.length == 1 ) { + if ( json.aaData.length == 1 && aoData.iDisplayStart == 0 ) { var borrowernumber = json.aaData[0].borrowernumber; /* Overwrite history state of firstletter search since only one result was returned; This prevents a loop upon clicking back */ history.replaceState( {}, null, window.location.href.split("?" )[0]); -- 2.39.5