X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2FUID.pm;h=bd2b70da27b731743d1b3985925255f13d845d02;hb=6560333ebff53283a67e04a8d5c019dc5e304120;hp=2307c9e11cb952189f63b04d21144cc08a69bd5a;hpb=063b112dd3d5340ec98f6fa960145e47639d5ffb;p=freeside.git diff --git a/FS/FS/UID.pm b/FS/FS/UID.pm index 2307c9e11..bd2b70da2 100644 --- a/FS/FS/UID.pm +++ b/FS/FS/UID.pm @@ -108,22 +108,26 @@ sub forksuidsetup { warn "$me forksuidsetup connected to database with handle $dbh\n" if $DEBUG; warn "$me forksuidsetup loading schema\n" if $DEBUG; - use FS::Schema qw(reload_dbdef); + use FS::Schema qw(reload_dbdef dbdef); reload_dbdef("$conf_dir/dbdef.$datasrc") unless $FS::Schema::setup_hack; warn "$me forksuidsetup deciding upon config system to use\n" if $DEBUG; - my $confcount = 0; + if ( dbdef->table('conf') ) { - my $sth = $dbh->prepare("SELECT COUNT(*) FROM conf") or warn $dbh->errstr; - $sth and $sth->execute or warn $sth->errstr; - $sth and $confcount = $sth->fetchrow_arrayref->[0]; + my $sth = $dbh->prepare("SELECT COUNT(*) FROM conf") or die $dbh->errstr; + $sth->execute or die $sth->errstr; + my $confcount = $sth->fetchrow_arrayref->[0]; + + if ($confcount) { + $use_confcompat = 0; + }else{ + warn "NO CONFIGURATION RECORDS FOUND"; + } - if ($confcount) { - $use_confcompat = 0; - }else{ - warn "NO CONFIGURATION RECORDS FOUND"; + } else { + warn "NO CONFIGURATION TABLE FOUND"; } unless ( $callback_hack ) {