From 1fffaa19c0f3767a26cfc738a2ffc5068d6294b6 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 Signed-off-by: Andrew Fuerste-Henry --- 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