[Koha-patches] [PATCH] Bug 6100: request.pl should check maxreserves exists
Ian Walls
ian.walls at bywatersolutions.com
Wed Apr 6 20:00:47 CEST 2011
From: Jared Camins-Esakov <jcamins at bywatersolutions.com>
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 <ian.walls at bywatersolutions.com>
---
reserve/request.pl | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/reserve/request.pl b/reserve/request.pl
index a047f4d..6579c3d 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;
}
--
1.5.6.5
More information about the Koha-patches
mailing list