X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FInstall%2FInitialize.html;h=9642d548f3489510a29f91c1b7d4e79198c7a104;hb=187086c479a09629b7d180eec513fb7657f4e291;hp=0b9ed6d39299dec3b81b61309cd6b0ee8ace16fc;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c;p=freeside.git diff --git a/rt/share/html/Install/Initialize.html b/rt/share/html/Install/Initialize.html index 0b9ed6d39..9642d548f 100644 --- a/rt/share/html/Install/Initialize.html +++ b/rt/share/html/Install/Initialize.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2018 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -73,6 +73,11 @@ if ( $Run ) { my @actions = split /,/, $RT::Installer->{DatabaseAction}; + # RT::Handle's ISA is dynamical, so we need to unshift the right one. + my $class = 'DBIx::SearchBuilder::Handle::' . RT->Config->Get('DatabaseType'); + $class->require or die $UNIVERSAL::require::ERROR; + unshift @RT::Handle::ISA, $class; + my $sysdbh = DBI->connect( RT::Handle->SystemDSN, $RT::Installer->{InstallConfig}{DatabaseAdmin}, @@ -110,17 +115,18 @@ if ( $Run ) { ($status, $msg) = RT::Handle->InsertACL( $dbh ); } elsif ( $action eq 'coredata' ) { - $RT::Handle = new RT::Handle; + $RT::Handle = RT::Handle->new; $RT::Handle->dbh( undef ); RT::ConnectToDatabase(); RT::InitLogging(); + RT::InitClasses(); ($status, $msg) = $RT::Handle->InsertInitialData; } elsif ( $action eq 'insert' ) { - $RT::Handle = new RT::Handle; + $RT::Handle = RT::Handle->new; RT::Init(); my $file = $RT::EtcPath . "/initialdata"; - ($status, $msg) = $RT::Handle->InsertData( $file ); + ($status, $msg) = $RT::Handle->InsertData( $file, undef, disconnect_after => 0 ); } unless ( $status ) { push @errors, loc('ERROR: [_1]', $msg);