From ef25c3665bcde5278512225297100f26d3dc531a Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 8 Apr 2014 22:46:28 +0000 Subject: [PATCH] Bug 7413: (follow-up) validate norenewalbefore values better This patch ensures both both '0' and strings consisting of zero or more blanks are recognized by the circ rules editor as specifying clearing the "no renewal before" value. Concretely, this fixes warnings of the following form when clearing this field: Argument "" isn't numeric in numeric eq (==) Signed-off-by: Galen Charlton --- admin/smart-rules.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index 6721ea4240..456e7384ca 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -115,7 +115,7 @@ elsif ($op eq 'add') { my $renewalsallowed = $input->param('renewalsallowed'); my $renewalperiod = $input->param('renewalperiod'); my $norenewalbefore = $input->param('norenewalbefore'); - $norenewalbefore = undef if $norenewalbefore == 0; + $norenewalbefore = undef if $norenewalbefore eq '0' or $norenewalbefore =~ /^\s*$/; my $reservesallowed = $input->param('reservesallowed'); $maxissueqty =~ s/\s//g; $maxissueqty = undef if $maxissueqty !~ /^\d+/; -- 2.39.5