From 6078357610cdad24725c54ad488656d95a57ef77 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 (cherry picked from commit 8b582d863debf1a60c69560b1cb797a9931bdcf8) Signed-off-by: Chris Nighswonger --- reserve/request.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reserve/request.pl b/reserve/request.pl index 7e513648eb..50017f16e6 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -142,7 +142,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