From d0e9cc812927cc65653145f27bc6351fcb3b869b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joonas=20Kylm=C3=A4l=C3=A4?= Date: Tue, 28 Jan 2020 15:05:15 +0000 Subject: [PATCH] Bug 18936: (follow-up) Make possible to have unlimited value for holds_per_day MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this it is not possible to make for a specific patron category or itemtype a more specific unlimited holds_per_day rule if you have a catch all rule (categorycode = *, itemtype = *) with limited holds_per_day value. Signed-off-by: Minna Kivinen Signed-off-by: Joonas Kylmälä --- C4/Reserves.pm | 2 +- admin/smart-rules.pl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 86ff1faebb..f84922782e 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -404,7 +404,7 @@ sub CanItemBeReserved { if ( defined $holds_per_day && ( ( $holds_per_day > 0 && $today_holds->count() >= $holds_per_day ) - or ( $holds_per_day == 0 ) ) + or ( $holds_per_day == 0 && $holds_per_day ne '') ) ) { return { status => 'tooManyReservesToday', limit => $holds_per_day }; } diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index ceb4a9be5b..75ed5164ca 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -277,7 +277,7 @@ elsif ($op eq 'add') { my $holds_per_record = $input->param('holds_per_record'); my $holds_per_day = $input->param('holds_per_day'); $holds_per_day =~ s/\s//g; - $holds_per_day = undef if $holds_per_day !~ /^\d+/; + $holds_per_day = '' if $holds_per_day !~ /^\d+/; my $onshelfholds = $input->param('onshelfholds') || 0; $maxissueqty =~ s/\s//g; $maxissueqty = '' if $maxissueqty !~ /^\d+/; -- 2.11.0