From 51f3ae2fd26201e5845621cd6d264d4e9442fc9a Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 24 Sep 2020 18:12:51 +0000 Subject: [PATCH] Bug 26529: Consider blank rules as undef for default hold policies --- admin/smart-rules.pl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index 4a4727e5c2..51bfb667b2 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -337,12 +337,10 @@ elsif ($op eq "set-branch-defaults") { my $patron_maxissueqty = strip_non_numeric( scalar $input->param('patron_maxissueqty') ); my $patron_maxonsiteissueqty = $input->param('patron_maxonsiteissueqty'); $patron_maxonsiteissueqty = strip_non_numeric($patron_maxonsiteissueqty); - my $holdallowed = $input->param('holdallowed'); - my $hold_fulfillment_policy = $input->param('hold_fulfillment_policy'); - my $returnbranch = $input->param('returnbranch'); + my $holdallowed = $input->param('holdallowed') || undef; + my $hold_fulfillment_policy = $input->param('hold_fulfillment_policy') || undef; + my $returnbranch = $input->param('returnbranch') || undef; my $max_holds = strip_non_numeric( scalar $input->param('max_holds') ); - $holdallowed =~ s/\s//g; - $holdallowed = undef if $holdallowed !~ /^\d+/; if ($branch eq "*") { Koha::CirculationRules->set_rules( -- 2.11.0