diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-13 05:19:26 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-13 05:19:26 +0000 |
commit | 3e6b9b5ea35dfb32e3c30a4d012f67c1d268a570 (patch) | |
tree | c7622db5a5d010790e58a567958a331ccb3eee6c /modules/taxonomy/taxonomy.admin.inc | |
parent | 09ba396ead3d326e7b7fab485c019fcae76f07bc (diff) | |
download | brdo-3e6b9b5ea35dfb32e3c30a4d012f67c1d268a570.tar.gz brdo-3e6b9b5ea35dfb32e3c30a4d012f67c1d268a570.tar.bz2 |
#876762 by Dave Reid, yched: Fixed modules have no way of knowing if vocabulary machine names are changed.
Diffstat (limited to 'modules/taxonomy/taxonomy.admin.inc')
-rw-r--r-- | modules/taxonomy/taxonomy.admin.inc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/taxonomy/taxonomy.admin.inc b/modules/taxonomy/taxonomy.admin.inc index a356304d4..7b81db26d 100644 --- a/modules/taxonomy/taxonomy.admin.inc +++ b/modules/taxonomy/taxonomy.admin.inc @@ -163,6 +163,10 @@ function taxonomy_form_vocabulary($form, &$form_state, $edit = array()) { 'js' => array(drupal_get_path('module', 'system') . '/system.js', $js_settings), ), ); + $form['old_machine_name'] = array( + '#type' => 'value', + '#value' => $vocabulary->machine_name, + ); $form['description'] = array( '#type' => 'textfield', '#title' => t('Description'), @@ -223,12 +227,10 @@ function taxonomy_form_vocabulary_submit($form, &$form_state) { $form_state['confirm_delete'] = TRUE; return; } - $old_machine_name = $form_state['vocabulary']->machine_name; + $vocabulary = $form_state['vocabulary']; entity_form_submit_build_entity('taxonomy_vocabulary', $vocabulary, $form, $form_state); - if ($vocabulary->machine_name != $old_machine_name) { - field_attach_rename_bundle('taxonomy_term', $old_machine_name, $vocabulary->machine_name); - } + switch (taxonomy_vocabulary_save($vocabulary)) { case SAVED_NEW: drupal_set_message(t('Created new vocabulary %name.', array('%name' => $vocabulary->name))); |