You are here

function pathauto_update_7003 in Pathauto 7

Rename 'taxonomy' variables to use the entity type 'taxonomy_term'.

File

./pathauto.install, line 167
Install, update, and uninstall functions for Pathauto.

Code

function pathauto_update_7003() {
  $variables = db_select('variable', 'v')
    ->fields('v', array(
    'name',
  ))
    ->condition(db_and()
    ->condition('name', db_like("pathauto_taxonomy_") . '%', 'LIKE')
    ->condition('name', db_like("pathauto_taxonomy_term_") . '%', 'NOT LIKE'))
    ->execute()
    ->fetchCol();
  foreach ($variables as $variable) {
    $value = variable_get($variable);
    variable_del($variable);
    $variable = strtr($variable, array(
      'pathauto_taxonomy_' => 'pathauto_taxonomy_term_',
    ));
    variable_set($variable, $value);
  }
}