diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc index 4c5ecd1..821e11a 100644 --- a/includes/bootstrap.inc +++ b/includes/bootstrap.inc @@ -3151,11 +3151,12 @@ function _registry_check_code($type, $name = NULL) { // 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 = db_select('registry', 'r', array('target' => 'default')) - ->fields('r', array('filename')) - ->condition('r.name', db_like($name), 'LIKE') - ->condition('r.type', $type) - ->execute() + $connection = Database::getConnection('default', 'default'); + $operator = $connection->mapConditionOperator('LIKE'); + $file = $connection->query("SELECT filename FROM {registry} WHERE name $operator[operator] :name AND type $operator[operator] :type", array( + ':name' => db_like($name), + ':type' => db_like($type), + )) ->fetchField(); // Flag that we've run a lookup query and need to update the cache.