From bc7859e8488887a9234b06b9fdd69c946268a414 Mon Sep 17 00:00:00 2001 From: Mark Tompsett Date: Tue, 2 Oct 2012 21:28:29 +0800 Subject: [PATCH] Bug 8861 - Undefined variables in batchMod.pl trigger error logs Initialized $op, and changed lines like "$op => 1" and "$error => 1" into separate, conditional template param calls. Signed-off-by: Kyle M Hall Signed-off-by: Chris Cormack --- tools/batchMod.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/batchMod.pl b/tools/batchMod.pl index b361a0b07d..03aaf5f08f 100755 --- a/tools/batchMod.pl +++ b/tools/batchMod.pl @@ -52,6 +52,7 @@ my $template_flag; if (!defined $op) { $template_name = "tools/batchMod.tmpl"; $template_flag = { tools => '*' }; + $op = q{}; } else { $template_name = ($del) ? "tools/batchMod-del.tmpl" : "tools/batchMod-edit.tmpl"; $template_flag = ($del) ? { tools => 'items_batchdel' } : { tools => 'items_batchmod' }; @@ -433,8 +434,8 @@ foreach my $tag (sort keys %{$tagslib}) { $template->param(%$items_display_hashref) if $items_display_hashref; $template->param( op => $nextop, - $op => 1, ); +$template->param( $op => 1 ) if $op; if ($op eq "action") { @@ -450,7 +451,7 @@ if ($op eq "action") { } foreach my $error (@errors) { - $template->param($error => 1); + $template->param($error => 1) if $error; } output_html_with_http_headers $input, $cookie, $template->output; exit; -- 2.39.5