From 3ad9369b0a0db16eab6a6551af82ae225bd84b54 Mon Sep 17 00:00:00 2001 From: Christopher Pitt Date: Fri, 28 Aug 2015 08:43:03 +1200 Subject: [PATCH] 3.2 compat --- code/search/SearchUpdater.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/search/SearchUpdater.php b/code/search/SearchUpdater.php index f98c477..f0b7590 100644 --- a/code/search/SearchUpdater.php +++ b/code/search/SearchUpdater.php @@ -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);