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 <david@davidnind.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Jonathan Druart 2022-02-07 17:27:37 +01:00 committed by Fridolin Somers
parent 9e6f00b142
commit e2306f85e7

View file

@ -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;