Bug 29136: Don't redirect if the whole set is > 1
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 7 Feb 2022 16:27:37 +0000 (17:27 +0100)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 9 Mar 2022 09:03:34 +0000 (23:03 -1000)
To prevent a redirect when we click on a page with only 1 result

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt

index 51b81e3..9f94f7b 100644 (file)
                         '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;