- Patch #535264 by Crell: removing some more legacy cruft.
parent
afb395d5b6
commit
4e96b4e5df
|
@ -2494,10 +2494,6 @@ function db_fetch_object(DatabaseStatementInterface $statement) {
|
|||
return $statement->fetch(PDO::FETCH_OBJ);
|
||||
}
|
||||
|
||||
function db_fetch_array(DatabaseStatementInterface $statement) {
|
||||
return $statement->fetch(PDO::FETCH_ASSOC);
|
||||
}
|
||||
|
||||
function db_result(DatabaseStatementInterface $statement) {
|
||||
return $statement->fetchField();
|
||||
}
|
||||
|
@ -2561,21 +2557,6 @@ function _db_query_process_args($query, $args, $options) {
|
|||
return array($query, $args, $options);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the last insert id.
|
||||
*
|
||||
* @todo Remove this function when all queries have been ported to db_insert().
|
||||
* @param $table
|
||||
* The name of the table you inserted into.
|
||||
* @param $field
|
||||
* The name of the autoincrement field.
|
||||
*/
|
||||
function db_last_insert_id($table, $field) {
|
||||
$sequence_name = Database::getConnection()->makeSequenceName($table, $field);
|
||||
return Database::getConnection()->lastInsertId($sequence_name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function for db_rewrite_sql.
|
||||
*
|
||||
|
@ -2693,21 +2674,6 @@ function db_rewrite_sql($query, $primary_table = 'n', $primary_field = 'nid', $
|
|||
return $query;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures the environment for a Drupal database on a predefined connection.
|
||||
*
|
||||
* This will run tasks that check that Drupal can perform all of the functions
|
||||
* on a database, that Drupal needs. Tasks include simple checks like CREATE
|
||||
* TABLE to database specfic functions like stored procedures and client
|
||||
* encoding.
|
||||
*/
|
||||
function db_run_tasks($driver) {
|
||||
$task_class = 'DatabaseTasks_' . $driver;
|
||||
$DatabaseTasks = new $task_class();
|
||||
$DatabaseTasks->runTasks();
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @} End of "ingroup database-legacy".
|
||||
*/
|
||||
|
|
|
@ -1083,8 +1083,8 @@ function install_profile_info($profile, $locale = 'en') {
|
|||
);
|
||||
$info = drupal_parse_info_file("profiles/$profile/$profile.info") + $defaults;
|
||||
$info['dependencies'] = array_unique(array_merge(
|
||||
drupal_required_modules(),
|
||||
$info['dependencies'],
|
||||
drupal_required_modules(),
|
||||
$info['dependencies'],
|
||||
($locale != 'en' && !empty($locale) ? array('locale') : array()))
|
||||
);
|
||||
$cache[$profile] = $info;
|
||||
|
@ -1092,3 +1092,17 @@ function install_profile_info($profile, $locale = 'en') {
|
|||
return $cache[$profile];
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures the environment for a Drupal database on a predefined connection.
|
||||
*
|
||||
* This will run tasks that check that Drupal can perform all of the functions
|
||||
* on a database, that Drupal needs. Tasks include simple checks like CREATE
|
||||
* TABLE to database specfic functions like stored procedures and client
|
||||
* encoding.
|
||||
*/
|
||||
function db_run_tasks($driver) {
|
||||
$task_class = 'DatabaseTasks_' . $driver;
|
||||
$DatabaseTasks = new $task_class();
|
||||
$DatabaseTasks->runTasks();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1119,7 +1119,6 @@ function menu_tree_collect_node_links(&$tree, &$node_links) {
|
|||
function menu_tree_check_access(&$tree, $node_links = array()) {
|
||||
|
||||
if ($node_links) {
|
||||
// Use db_rewrite_sql to evaluate view access without loading each full node.
|
||||
$nids = array_keys($node_links);
|
||||
$select = db_select('node');
|
||||
$select->addField('node', 'nid');
|
||||
|
@ -1269,7 +1268,7 @@ function theme_menu_tree($tree) {
|
|||
* The menu item's LI element is given one of the following classes:
|
||||
* - expanded: The menu item is showing its submenu.
|
||||
* - collapsed: The menu item has a submenu which is not shown.
|
||||
* - leaf: The menu item has no submenu.
|
||||
* - leaf: The menu item has no submenu.
|
||||
*
|
||||
* @ingroup themeable
|
||||
*
|
||||
|
|
|
@ -1358,7 +1358,7 @@ class FieldCrudTestCase extends DrupalWebTestCase {
|
|||
// Simulate a stored field definition missing a field setting (e.g. a
|
||||
// third-party module adding a new field setting has been enabled, and
|
||||
// existing fields do not know the setting yet).
|
||||
$data = db_result(db_query('SELECT data FROM {field_config} WHERE field_name = :field_name', array(':field_name' => $field_definition['field_name'])));
|
||||
$data = db_query('SELECT data FROM {field_config} WHERE field_name = :field_name', array(':field_name' => $field_definition['field_name']))->fetchField();
|
||||
$data = unserialize($data);
|
||||
$data['settings'] = array();
|
||||
db_update('field_config')
|
||||
|
@ -1588,7 +1588,7 @@ class FieldInstanceCrudTestCase extends DrupalWebTestCase {
|
|||
// Simulate a stored instance definition missing various settings (e.g. a
|
||||
// third-party module adding instance, widget or display settings has been
|
||||
// enabled, but existing instances do not know the new settings).
|
||||
$data = db_result(db_query('SELECT data FROM {field_config_instance} WHERE field_name = :field_name AND bundle = :bundle', array(':field_name' => $this->instance_definition['field_name'], ':bundle' => $this->instance_definition['bundle'])));
|
||||
$data = db_query('SELECT data FROM {field_config_instance} WHERE field_name = :field_name AND bundle = :bundle', array(':field_name' => $this->instance_definition['field_name'], ':bundle' => $this->instance_definition['bundle']))->fetchField();
|
||||
$data = unserialize($data);
|
||||
$data['settings'] = array();
|
||||
$data['widget']['settings'] = array();
|
||||
|
|
Loading…
Reference in New Issue