diff options
-rw-r--r-- | includes/bootstrap.inc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 55bf09574..c3f553793 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -1447,7 +1447,10 @@ function drupal_autoload_class($class) { * Helper to check for a resource in the registry. */ function _registry_check_code($type, $name) { - $file = db_query("SELECT filename FROM {registry} WHERE name = :name AND type = :type", array( + // This function may get called when the default database is not active, but + // there is no reason we'd ever want to not use the default database for + // this query. + $file = Database::getConnection('default')->query("SELECT filename FROM {registry} WHERE name = :name AND type = :type", array( ':name' => $name, ':type' => $type, )) @@ -1507,7 +1510,10 @@ function registry_cache_path_files() { $type_sql = array(); $params = array(); - $select = db_select('registry')->distinct(); + // This function may get called when the default database is not active, but + // there is no reason we'd ever want to not use the default database for + // this query. + $select = Database::getConnection('default')->select('registry')->distinct(); $select->addField('registry', 'filename'); // This creates a series of 2-clause AND conditions that are then ORed together. |