X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FUID.pm;h=dd4850fb285b6bbb4e039799e6c8c5a75f39f19e;hb=eaafe49123e402598d1e350c5654b7870073740d;hp=2307c9e11cb952189f63b04d21144cc08a69bd5a;hpb=063b112dd3d5340ec98f6fa960145e47639d5ffb;p=freeside.git diff --git a/FS/FS/UID.pm b/FS/FS/UID.pm index 2307c9e11..dd4850fb2 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 ( ! $FS::Schema::setup_hack && 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 ) {