From 59a6072c77cf85ab93d7a5485b8a7b0a75f8ebd3 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 30 Apr 2010 05:49:19 -0400 Subject: [PATCH] bug 4333 followup - fix an uninitialized value warning Signed-off-by: Galen Charlton --- admin/currency.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/admin/currency.pl b/admin/currency.pl index 003ff89858..1e3f16082b 100755 --- a/admin/currency.pl +++ b/admin/currency.pl @@ -181,9 +181,6 @@ sub add_form { sub add_validate { $template->param( add_validate => 1 ); - if ( $input->param('active') == 1 ) { - $dbh->do('UPDATE currency SET active = 0'); - } my $rec = { rate => $input->param('rate'), symbol => $input->param('symbol') || q{}, @@ -191,6 +188,10 @@ sub add_validate { currency => $input->param('currency'), }; + if ( $rec->{active} == 1 ) { + $dbh->do('UPDATE currency SET active = 0'); + } + my ($row_count) = $dbh->selectrow_array( 'select count(*) as count from currency where currency = ?', {}, $input->param('currency') ); -- 2.39.5