From d1b2601b01c9c556555fc085948c19ba5f299c9e Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Mon, 21 Mar 2022 12:18:57 -1000 Subject: [PATCH] Bug 30325: (Bug 30098 follow-up) Fix broken patron search redirect when one result Bug 30098 fixed patron search behavior when a later page has only 1 result, but broke the redirect when there is only a single result from search. 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 - On third page you remain in results and are not redirected 4 - Perform a patron search that return only 1 result, name or cardnumber 5 - You get redirected to this patron page Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart Signed-off-by: Fridolin Somers --- 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 5c779cc6b0..fd37ab2e51 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 && aoData.iDisplayStart == 0 ) { + if ( json.iTotalDisplayRecords == 1 ) { 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