summaryrefslogtreecommitdiff
path: root/modules/taxonomy
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2010-10-15 05:25:32 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2010-10-15 05:25:32 +0000
commitb5e43a99ab39dd63ca8a225986a35d2ed9d5f64e (patch)
treeaeb769aad53e2f0c9354ba5b6144f7601437979c /modules/taxonomy
parentaa301ada485cc9e99f73fb81635909bdb3c1c3e8 (diff)
downloadbrdo-b5e43a99ab39dd63ca8a225986a35d2ed9d5f64e.tar.gz
brdo-b5e43a99ab39dd63ca8a225986a35d2ed9d5f64e.tar.bz2
#876762 follow-up by yched: Move taxonomy vocabulary rename checking logic to hook_taxonomy_vocabulary_update().
Diffstat (limited to 'modules/taxonomy')
-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;
}
}