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:
parent
0645f83c22
commit
8b582d863d
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue