Index: modules/forum/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v
retrieving revision 1.498
diff -u -p -r1.498 forum.module
--- modules/forum/forum.module	4 Jun 2009 03:33:27 -0000	1.498
+++ modules/forum/forum.module	4 Jun 2009 17:32:09 -0000
@@ -438,7 +438,7 @@ function forum_taxonomy($op, $type, $ter
  */
 function forum_form_alter(&$form, $form_state, $form_id) {
   $vid = variable_get('forum_nav_vocabulary', '');
-  if (isset($form['vid']) && $form['vid']['#value'] == $vid) {
+  if (isset($form['#vocabulary']) && $form['#vocabulary']->vid == $vid) {
     // Hide critical options from forum vocabulary.
     if ($form_id == 'taxonomy_form_vocabulary') {
       $form['help_forum_vocab'] = array(
Index: modules/taxonomy/taxonomy.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v
retrieving revision 1.53
diff -u -p -r1.53 taxonomy.admin.inc
--- modules/taxonomy/taxonomy.admin.inc	4 Jun 2009 03:33:29 -0000	1.53
+++ modules/taxonomy/taxonomy.admin.inc	4 Jun 2009 17:32:10 -0000
@@ -708,9 +708,18 @@ function taxonomy_form_term(&$form_state
     '#default_value' => $edit['weight'],
     '#description' => t('Terms are displayed in ascending order by weight.'),
     '#required' => TRUE);
-  $form['vid'] = array(
-    '#type' => 'value',
-    '#value' => $vocabulary->vid);
+
+  $vocabularies = taxonomy_get_vocabularies();
+  $options = array();
+  foreach ($vocabularies as $option) {
+    $options[$option->vid] = $option->name;
+  }
+  $form['advanced']['vid'] = array(
+    '#title' => t('Vocabulary'),
+    '#type' => 'select',
+    '#default_value' => $vocabulary->vid,
+    '#options' => $options,
+  );
   $form['submit'] = array(
     '#type' => 'submit',
     '#value' => t('Save'));
@@ -736,6 +745,10 @@ function taxonomy_form_term(&$form_state
  * @see taxonomy_form_term()
  */
 function taxonomy_form_term_validate($form, &$form_state) {
+  // Do not allow vocabulary to be changed if the term has parents, children or relations.
+  if ($form_state['values']['vid'] != $form['#vocabulary']->vid && ($form_state['values']['parent'] || $form_state['values']['relations'] || (isset($form_state['values']['tid']) && taxonomy_get_children($form_state['values']['tid'])))) {
+    form_set_error('vocabulary', t('You may not change vocabulary for a term with parents, children or related terms'));
+  }
   if (isset($form_state['values']['weight']) && !is_numeric($form_state['values']['weight'])) {
     form_set_error('weight', t('Weight value must be numeric.'));
   }
Index: modules/taxonomy/taxonomy.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.test,v
retrieving revision 1.32
diff -u -p -r1.32 taxonomy.test
--- modules/taxonomy/taxonomy.test	3 Jun 2009 19:34:53 -0000	1.32
+++ modules/taxonomy/taxonomy.test	4 Jun 2009 17:32:10 -0000
@@ -378,6 +378,20 @@ class TaxonomyTermTestCase extends Taxon
   }
 
   /**
+   * Test the vocabulary field on term forms.
+   */
+  function testTaxonomyVocabularyField() {
+    $term1 = $this->createTerm($this->vocabulary->vid);
+    $this->assertEqual($term1->vid, $this->vocabulary->vid, t('Term vid is equal to the original vocabulary.'));
+    $vocabulary2 = $this->createVocabulary();
+    $edit = array();
+    $edit['vid'] = $vocabulary2->vid;
+    $this->drupalPost('taxonomy/term/' . $term1->tid . '/edit', $edit, t('Save'));
+    $term1 = taxonomy_term_load($term1->tid);
+    $this->assertEqual($term1->vid, $vocabulary2->vid, t('Term vid is equal to the new vocabulary.'));
+  }
+
+  /**
    * Test related terms.
    */
   function testTaxonomyTermRelations() {
