Index: modules/taxonomy/taxonomy.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v
retrieving revision 1.98
diff -u -p -r1.98 taxonomy.admin.inc
--- modules/taxonomy/taxonomy.admin.inc	28 Mar 2010 11:39:35 -0000	1.98
+++ modules/taxonomy/taxonomy.admin.inc	5 Apr 2010 20:23:54 -0000
@@ -686,6 +686,9 @@ function taxonomy_form_term($form, &$for
 
     $tree = taxonomy_get_tree($vocabulary->vid);
     $options = array('<' . t('root') . '>');
+    if (empty($parent)) {
+      $parent = array(0);
+    }
     foreach ($tree as $term) {
       if (!in_array($term->tid, $exclude)) {
         $options[$term->tid] = str_repeat('-', $term->depth) . $term->name;
Index: modules/taxonomy/taxonomy.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.test,v
retrieving revision 1.75
diff -u -p -r1.75 taxonomy.test
--- modules/taxonomy/taxonomy.test	27 Mar 2010 05:52:50 -0000	1.75
+++ modules/taxonomy/taxonomy.test	5 Apr 2010 20:23:54 -0000
@@ -486,12 +486,17 @@ class TaxonomyTermTestCase extends Taxon
     // Edit the term.
     $this->drupalPost('taxonomy/term/' . $term->tid . '/edit', $edit, t('Save'));
 
+    // Check that the term is still present at admin UI after edit.
+    $this->drupalGet('admin/structure/taxonomy/' . $this->vocabulary->machine_name);
+    $this->assertText($edit['name'], t('The randomly generated term name is present.'));
+    $this->assertLink(t('edit'));
+
     // View the term and check that it is correct.
     $this->drupalGet('taxonomy/term/' . $term->tid);
     $this->assertText($edit['name'], t('The randomly generated term name is present.'));
     $this->assertText($edit['description[value]'], t('The randomly generated term description is present.'));
 
-    // Check that term feed page is working
+    // Check that the term feed page is working.
     $this->drupalGet('taxonomy/term/' . $term->tid . '/feed');
 
     // Delete the term.
