summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB')
-rwxr-xr-xLedgerSMB/Form.pm5
1 files changed, 5 insertions, 0 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);