From f8fcab514b79886400a8a08ce9fc5eb6332f6f91 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Wed, 8 Aug 2007 11:59:59 +0200 Subject: [PATCH] fixing buggy reserve script Signed-off-by: Chris Cormack --- opac/opac-reserve.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 5e85aa8b15..3480e01f73 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -296,12 +296,12 @@ else { debarred => 1 ); } - my @reserves = GetReservesFromBorrowernumber( $borrowernumber ); - $template->param( RESERVES => \@reserves ); - if ( scalar(@$reserves) >= $MAXIMUM_NUMBER_OF_RESERVES ) { + my (@reserves) = GetReservesFromBorrowernumber( $borrowernumber ); + $template->param( RESERVES => $reserves ); + if ( $#reserves+1 >= $MAXIMUM_NUMBER_OF_RESERVES ) { $template->param( message => 1 ); $noreserves = 1; - $template->param( too_many_reserves => scalar($reserves)); + $template->param( too_many_reserves => $#reserves+1 ); } foreach my $res (@$reserves) { if ( $res->{'biblionumber'} == $biblionumber ) { -- 2.39.5