summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/taxonomy/taxonomy.module14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index e353c9584..b36bca9c3 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -441,19 +441,19 @@ function taxonomy_vocabulary_delete($vid) {
}
/**
- * Implements hook_field_attach_rename_bundle().
+ * Implements hook_taxonomy_vocabulary_update().
*/
-function taxonomy_field_attach_rename_bundle($entity_type, $bundle_old, $bundle_new) {
- if ($entity_type == 'taxonomy_term') {
- // Reflect machine name changes in the definitions of existing 'taxonomy'
- // fields.
+function taxonomy_taxonomy_vocabulary_update($vocabulary) {
+ // Reflect machine name changes in the definitions of existing 'taxonomy'
+ // fields.
+ if (!empty($vocabulary->old_machine_name) && $vocabulary->old_machine_name != $vocabulary->machine_name) {
$fields = field_read_fields();
foreach ($fields as $field_name => $field) {
$update = FALSE;
if ($field['type'] == 'taxonomy_term_reference') {
foreach ($field['settings']['allowed_values'] as $key => &$value) {
- if ($value['vocabulary'] == $bundle_old) {
- $value['vocabulary'] = $bundle_new;
+ if ($value['vocabulary'] == $vocabulary->old_machine_name) {
+ $value['vocabulary'] = $vocabulary->machine_name;
$update = TRUE;
}
}