Index: modules/taxonomy/taxonomy.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v
retrieving revision 1.72
diff -u -p -r1.72 taxonomy.admin.inc
--- modules/taxonomy/taxonomy.admin.inc	9 Oct 2009 01:00:05 -0000	1.72
+++ modules/taxonomy/taxonomy.admin.inc	13 Oct 2009 15:13:58 -0000
@@ -684,9 +684,18 @@ function taxonomy_form_term($form, &$for
     '#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'));
@@ -718,6 +727,10 @@ function taxonomy_form_term_validate($fo
   if (isset($form_state['values']['weight']) && !is_numeric($form_state['values']['weight'])) {
     form_set_error('weight', t('Weight value must be numeric.'));
   }
+  // Do not allow vocabulary to be changed if the term has parents or children.
+  if ($form_state['values']['vid'] != $form['#vocabulary']->vid && ($form_state['values']['parent'] ||  (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'));
+  }
 }
 
 /**
Index: modules/taxonomy/taxonomy.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.test,v
retrieving revision 1.49
diff -u -p -r1.49 taxonomy.test
--- modules/taxonomy/taxonomy.test	11 Oct 2009 03:07:20 -0000	1.49
+++ modules/taxonomy/taxonomy.test	13 Oct 2009 15:13:59 -0000
@@ -385,6 +385,21 @@ 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 that hook_node_$op implementations work correctly.
    *
    * Save & edit a node and assert that taxonomy terms are saved/loaded properly.
