diff options
Diffstat (limited to 'LedgerSMB')
-rw-r--r-- | LedgerSMB/AM.pm | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/LedgerSMB/AM.pm b/LedgerSMB/AM.pm index b6834e53..3885829e 100644 --- a/LedgerSMB/AM.pm +++ b/LedgerSMB/AM.pm @@ -1833,22 +1833,14 @@ sub save_defaults { $sth_defcheck->execute() || $form->dberror("execute defaults $_"); while(my $found1=$sth_defcheck->fetchrow()){$found=$found1;} - if($val ne '') - { - if($found) - { - $dbh->do("update defaults set value=" . $dbh->quote($val) . " where setting_key='$_';"); - } - else - { - $dbh->do("insert into defaults(value,setting_key) values( " . $dbh->quote($val) . ",'$_');"); - } - } - else - { - if($found){$dbh->do("delete from defaults where setting_key='$_';")}; - - } + if($found) + { + $dbh->do("update defaults set value=" . $dbh->quote($val) . " where setting_key='$_';"); + } + else + { + $dbh->do("insert into defaults(value,setting_key) values( " . $dbh->quote($val) . ",'$_');"); + } } |