mirror of
https://github.com/silverstripe/silverstripe-fulltextsearch
synced 2024-10-22 14:05:29 +02:00
commit
c3cc3f999b
@ -43,7 +43,16 @@ class SearchUpdater extends Object {
|
||||
require_once($file);
|
||||
$dbClass = 'SearchManipulateCapture_'.$type;
|
||||
|
||||
/** @var SS_Database $captured */
|
||||
$captured = new $dbClass($databaseConfig);
|
||||
|
||||
// Framework 3.2+ ORM needs some dependencies set
|
||||
if (method_exists($captured, "setConnector")) {
|
||||
$captured->setConnector($current->getConnector());
|
||||
$captured->setQueryBuilder($current->getQueryBuilder());
|
||||
$captured->setSchemaManager($current->getSchemaManager());
|
||||
}
|
||||
|
||||
// The connection might have had it's name changed (like if we're currently in a test)
|
||||
$captured->selectDatabase($current->currentDatabase());
|
||||
DB::setConn($captured);
|
||||
|
Loading…
Reference in New Issue
Block a user