From 8b582d863debf1a60c69560b1cb797a9931bdcf8 Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Wed, 6 Apr 2011 14:00:47 -0400 Subject: [PATCH] Bug 6100: request.pl should check maxreserves exists Adds a check to confirm that the maxreserves syspref actually has a value before using it. Also fixes an off-by-one error in the maxreserves calculation that would allow librarians to place maxreserves + 1 holds for patrons. Signed-off-by: Ian Walls Signed-off-by: Chris Cormack --- reserve/request.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reserve/request.pl b/reserve/request.pl index a047f4d894..6579c3d7e0 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -143,7 +143,7 @@ if ($cardnumber) { my $number_reserves = GetReserveCount( $borrowerinfo->{'borrowernumber'} ); - if ( $number_reserves > C4::Context->preference('maxreserves') ) { + if ( C4::Context->preference('maxreserves') && $number_reserves >= C4::Context->preference('maxreserves') ) { $warnings = 1; $maxreserves = 1; } -- 2.39.5