From 7accbfd3917470c91407fa8fef03ac4fb5cd3249 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 17 Nov 2022 09:28:39 +0100 Subject: [PATCH] Bug 30794: Insert blank rule (unlimited) for max_holds Content-Type: text/plain; charset=utf-8 Related to bug 24669, why didn't we use strip_non_numeric for one occurrence? Note that there is still a problem, if none of the 3 inputs is filled, no rule will be created (ie. action ignored) Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Marcel de Rooy --- admin/smart-rules.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index b71179437f..7de8899b28 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -415,8 +415,7 @@ elsif ($op eq "add-branch-cat") { my $patron_maxonsiteissueqty = $input->param('patron_maxonsiteissueqty'); $patron_maxonsiteissueqty = strip_non_numeric($patron_maxonsiteissueqty); my $max_holds = $input->param('max_holds'); - $max_holds =~ s/\s//g; - $max_holds = undef if $max_holds !~ /^\d+/; + $max_holds = strip_non_numeric($max_holds); if ($branch eq "*") { if ($categorycode eq "*") { -- 2.30.2