Index: modules/taxonomy/taxonomy.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.admin.inc,v
retrieving revision 1.101
diff -u -p -r1.101 taxonomy.admin.inc
--- modules/taxonomy/taxonomy.admin.inc	13 Apr 2010 15:23:03 -0000	1.101
+++ modules/taxonomy/taxonomy.admin.inc	22 Apr 2010 21:29:26 -0000
@@ -624,7 +624,8 @@ function taxonomy_form_term($form, &$for
     'format' => filter_default_format(),
     'vocabulary_machine_name' => $vocabulary->machine_name,
     'tid' => NULL,
-    'weight' => 0,
+    // Using empty string for simulating empty user input.
+    'weight' => '',
   );
 
   // Take into account multi-step rebuilding.
@@ -657,7 +658,7 @@ function taxonomy_form_term($form, &$for
   $form['description'] = array(
     '#type' => 'text_format',
     '#title' => t('Description'),
-    '#default_value' => $edit['description'],
+    '#value' => $edit['description'],
     '#format' => $edit['format'],
     '#weight' => 0,
   );
@@ -716,8 +717,7 @@ function taxonomy_form_term($form, &$for
     '#title' => t('Weight'),
     '#size' => 6,
     '#default_value' => $edit['weight'],
-    '#description' => t('Terms are displayed in ascending order by weight.'),
-    '#required' => TRUE,
+    '#description' => t('Terms are displayed in ascending order by weight. By default, the term will be appended to the end of the term list.'),
   );
   $form['vid'] = array(
     '#type' => 'value',
@@ -763,8 +763,8 @@ function taxonomy_form_term_validate($fo
   field_attach_form_validate('taxonomy_term', (object) $form_state['values'], $form, $form_state);
 
   // Ensure numeric values.
-  if (isset($form_state['values']['weight']) && !is_numeric($form_state['values']['weight'])) {
-    form_set_error('weight', t('Weight value must be numeric.'));
+  if (isset($form_state['values']['weight']) && !(is_numeric($form_state['values']['weight']) || $form_state['values']['weight'] === "")) {
+    form_set_error('weight', t('Weight value must be numeric or left empty.'));
   }
 }
 
@@ -793,6 +793,23 @@ function taxonomy_form_term_submit($form
 
   $term = taxonomy_form_term_submit_builder($form, $form_state);
 
+  // Term with empty weight is appended to the end by setting its weight to
+  // "maximum weight + 1".
+  if ($term->weight === '') {
+
+    // Fetch the max weight.
+    $max_weight = db_query("SELECT MAX(weight) FROM {taxonomy_term_data} WHERE vid = :vid", array(':vid' => $term->vid))->fetchField();
+
+    // No terms available in vocabulary, set weight to 0.
+    if ($max_weight == NULL) {
+      $term->weight = 0;
+    }
+    // Terms available, set weight to max + 1.
+    else {
+      $term->weight = $max_weight + 1;
+    }
+  }
+
   $status = taxonomy_term_save($term);
   switch ($status) {
     case SAVED_NEW:
