You are here

function pathauto_field_attach_rename_bundle in Pathauto 6

Same name and namespace in other branches
  1. 6.2 pathauto.module \pathauto_field_attach_rename_bundle()
  2. 7 pathauto.module \pathauto_field_attach_rename_bundle()

Implements hook_field_attach_rename_bundle().

Respond to machine name changes for pattern variables.

1 call to pathauto_field_attach_rename_bundle()
pathauto_node_type in ./pathauto.module
Implements hook_node_type().

File

./pathauto.module, line 232
Main file for the Pathauto module, which automatically generates aliases for content.

Code

function pathauto_field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new) {
  $result = db_query("SELECT name FROM {variable} WHERE name LIKE '%s%%'", "pathauto_{$entity_type}_{$bundle_old}_");
  while ($variable = db_result($result)) {
    $value = variable_get($variable, '');
    variable_del($variable);
    $variable = strtr($variable, array(
      "{$entity_type}_{$bundle_old}" => "{$entity_type}_{$bundle_new}",
    ));
    variable_set($variable, $value);
  }
}