From e2306f85e79f76ca8e5165d4b78afdb69b452aeb Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 7 Feb 2022 17:27:37 +0100 Subject: [PATCH] Bug 29136: Don't redirect if the whole set is > 1 To prevent a redirect when we click on a page with only 1 result Signed-off-by: David Nind Signed-off-by: Nick Clemens Signed-off-by: Fridolin Somers --- koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index 51b81e3990..9f94f7be89 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -1598,7 +1598,7 @@ 'data': aoData, 'success': function(json){ // redirect if there is only 1 result. - if ( json.aaData.length == 1 ) { + if ( json.iTotalDisplayRecords == 1 ) { var borrowernumber = json.aaData[0].borrowernumber; document.location.href = '/cgi-bin/koha/reserve/request.pl?borrowernumber=' + borrowernumber + "[% url_biblio_params %]" return false; -- 2.39.5