diff options
-rwxr-xr-x | LedgerSMB/Form.pm | 5 | ||||
-rwxr-xr-x | bin/admin.pl | 1 | ||||
-rwxr-xr-x | menu.pl | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm index 5f7adb01..4b6fbad2 100755 --- a/LedgerSMB/Form.pm +++ b/LedgerSMB/Form.pm @@ -2704,8 +2704,13 @@ sub update_defaults { my ($self, $myconfig, $fld) = @_; + if (!$self->{dbh}){ + $self->db_init($myconfig); + } + my $dbh = $self->{dbh}; + my $query = qq|SELECT $fld FROM defaults FOR UPDATE|; ($_) = $dbh->selectrow_array($query); diff --git a/bin/admin.pl b/bin/admin.pl index 9a90830a..88ecc367 100755 --- a/bin/admin.pl +++ b/bin/admin.pl @@ -754,6 +754,7 @@ sub form_header { sub save { + $form->db_init; # no driver checked $form->error($locale->text('Database Driver not checked!')) unless $form->{dbdriver}; @@ -106,7 +106,6 @@ $SIG{__DIE__} = sub { $form->error($_[0]) }; $myconfig{dbpasswd} = unpack 'u', $myconfig{dbpasswd}; map { $form->{$_} = $myconfig{$_} } qw(stylesheet timeout) unless ($form->{type} eq 'preferences'); - $form->db_init(\%myconfig); if ($form->{path} ne 'bin/lynx'){ $form->{path} = 'bin/mozilla';} |