From 84711d3d23874dfc8cc41297b4b0d1a0c550846b Mon Sep 17 00:00:00 2001 From: Andrew Nugged Date: Tue, 19 May 2020 11:03:13 +0300 Subject: [PATCH] Bug 25440: Fix for "uninitialized value in string eq" in smart-rules.pl This warning emitted: Use of uninitialized value in string eq at /admin/smart-rules.pl line 289. It is solved by one line added to exclude comparison with 'on' string when variable is 'undef'. Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart (cherry picked from commit 5eebfcf68747b4886b23a9d4c8df37ea7d103edb) Signed-off-by: Lucas Gass --- 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 e8f2da4a45..ca890e116b 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -287,7 +287,7 @@ elsif ($op eq 'add') { my $opacitemholds = $input->param('opacitemholds') || 0; my $article_requests = $input->param('article_requests') || 'no'; my $overduefinescap = $input->param('overduefinescap') || ''; - my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on'; + my $cap_fine_to_replacement_price = ($input->param('cap_fine_to_replacement_price') || '') eq 'on'; my $note = $input->param('note'); $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price"; -- 2.39.5