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