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 <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Jared Camins-Esakov 2011-04-06 14:00:47 -04:00 committed by Chris Cormack
parent 0645f83c22
commit 8b582d863d

View file

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