bug 4333 followup - fix an uninitialized value warning
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
parent
7604bf89f5
commit
59a6072c77
1 changed files with 4 additions and 3 deletions
|
@ -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') );
|
||||
|
|
Loading…
Reference in a new issue