From: Galen Charlton Date: Fri, 30 Apr 2010 09:49:19 +0000 (-0400) Subject: bug 4333 followup - fix an uninitialized value warning X-Git-Tag: v3.02.00-alpha2~50 X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=59a6072c77cf85ab93d7a5485b8a7b0a75f8ebd3;p=koha.git bug 4333 followup - fix an uninitialized value warning Signed-off-by: Galen Charlton --- 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') );