Skip to content

Commit

Permalink
Remove update_N
Browse files Browse the repository at this point in the history
  • Loading branch information
docwilmot committed Mar 27, 2016
1 parent 7dcbfb1 commit 2713bef
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 78 deletions.
27 changes: 0 additions & 27 deletions i18n_node/i18n_node.install
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,3 @@ function i18n_node_update_dependencies() {
);
return $dependencies;
}

/**
* Implements hook_i18n_update_backdrop6().
*
* Update old string names
*/
function i18n_node_update_7000() {
// @todo Update from D6 i18n
// Variables:
// i18n_newnode_current, i18n_required_node, i18n_lock_node => i18n_node_options_[node_type]
// i18n_node => 'i18n_node_extended_[node_type]'
// Update string names
// - nodetype:type:[type]:[property] -> node:type:[type]:[property]
// - Property names: title -> title_label
module_load_install('i18n_string');
i18n_string_install_update_context('nodetype:type:*:*', 'node:type:*:*');
i18n_string_install_update_context('node:type:*:title', 'node:type:*:title_label');
}

/**
* Delete obsoleted variable for switch interface for translating.
*/
/*
function i18n_node_update_7001() {
variable_del('i18n_node_translation_switch');
}
*/
51 changes: 0 additions & 51 deletions i18n_variable/i18n_variable.install
Original file line number Diff line number Diff line change
Expand Up @@ -30,54 +30,3 @@ function i18n_variable_uninstall() {
variable_store_delete_all('language', NULL);
}
}

/**
* Update multilingual variables variable name
*/
function i18n_variable_update_7000() {
config_set('i18n.settings', 'i18n_variable_list', variable_get('i18n_variables', array()));
config_set('i18n.settings', 'i18n_variable_conf', variable_get('i18n_variables', array()));
variable_del('i18n_variables');
}

/**
* Move variables from old storage to new table
*/
function i18n_variable_update_7001() {
backdrop_load('module', 'variable_store');
foreach (db_select('i18n_variable', 'v')->fields('v')->execute()->fetchAll() as $variable) {
variable_store_set('language', $variable->language, $variable->name, unserialize($variable->value));
}
}

/**
* Drop i18n_variable table if exists
*/
function i18n_variable_update_7002() {
if (db_table_exists('i18n_variable')) {
db_drop_table('i18n_variable');
}
}

/**
* Update list of realm variables.
*/
function i18n_variable_update_7003() {
backdrop_load('module', 'variable_store');
$variable_list = variable_get('i18n_variable_conf', array());
variable_set('variable_realm_list_language', $variable_list);
// Delete old variables from store that are not in the list.
$old_variables = array_diff(variable_store_list_all('language'), variable_children($variable_list));
foreach ($old_variables as $name) {
variable_store_delete_all('language', NULL, $name);
}
}

/**
* Delete obsoleted variable realm variables.
*/
function i18n_variable_update_7004() {
variable_del('i18n_variable_conf');
variable_del('i18n_variable_list');
}

0 comments on commit 2713bef

Please sign in to comment.