Index: modules/filter/filter.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.admin.inc,v
retrieving revision 1.69
diff -u -p -r1.69 filter.admin.inc
--- modules/filter/filter.admin.inc	22 Oct 2010 16:36:14 -0000	1.69
+++ modules/filter/filter.admin.inc	29 Nov 2010 22:44:38 -0000
@@ -104,6 +104,8 @@ function filter_admin_format_page($forma
     $format = (object) array(
       'format' => NULL,
       'name' => '',
+      'status' => 1,
+      'weight' => 0,
     );
   }
   return drupal_get_form('filter_admin_format_form', $format);
@@ -140,6 +142,14 @@ function filter_admin_format_form($form,
     ),
     '#disabled' => !empty($format->format),
   );
+  $form['status'] = array(
+    '#type' => 'value',
+    '#value' => $format->status,
+  );
+  $form['weight'] = array(
+    '#type' => 'value',
+    '#value' => $format->weight,
+  );
 
   // Add user role access selection.
   $form['roles'] = array(
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.359
diff -u -p -r1.359 filter.module
--- modules/filter/filter.module	21 Nov 2010 09:16:54 -0000	1.359
+++ modules/filter/filter.module	29 Nov 2010 22:45:05 -0000
@@ -173,6 +173,8 @@ function filter_format_load($format_id) 
  *     to save. If this corresponds to an existing text format, that format
  *     will be updated; otherwise, a new format will be created.
  *   - 'name': The title of the text format.
+ *   - 'status': (optional) An integer indicating whether the text format is
+ *     enabled (1) or not (0). Defaults to 1.
  *   - 'weight': (optional) The weight of the text format, which controls its
  *     placement in text format lists. If omitted, the weight is set to 0.
  *   - 'filters': (optional) An associative, multi-dimensional array of filters
Index: modules/filter/filter.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.test,v
retrieving revision 1.81
diff -u -p -r1.81 filter.test
--- modules/filter/filter.test	29 Nov 2010 06:38:51 -0000	1.81
+++ modules/filter/filter.test	29 Nov 2010 22:46:44 -0000
@@ -185,22 +185,36 @@ class FilterAdminTestCase extends Drupal
     // Add text format.
     $this->drupalGet('admin/config/content/formats');
     $this->clickLink('Add text format');
+    $format_id = drupal_strtolower($this->randomName());
+    $name = $this->randomName();
     $edit = array(
-      'format' => drupal_strtolower($this->randomName()),
-      'name' => $this->randomName(),
+      'format' => $format_id,
+      'name' => $name,
     );
     $this->drupalPost(NULL, $edit, t('Save configuration'));
 
+    // Verify default weight of the text format.
+    $this->drupalGet('admin/config/content/formats');
+    $this->assertFieldByName("formats[$format_id][weight]", 0, t('Text format weight was saved.'));
+
+    // Change the weight of the text format.
+    $edit = array(
+      "formats[$format_id][weight]" => 5,
+    );
+    $this->drupalPost('admin/config/content/formats', $edit, t('Save changes'));
+    $this->assertFieldByName("formats[$format_id][weight]", 5, t('Text format weight was saved.'));
+
     // Edit text format.
-    $format_id = $edit['format'];
-    $name = $edit['name'];
     $this->drupalGet('admin/config/content/formats');
     $this->assertLinkByHref('admin/config/content/formats/' . $format_id);
     $this->drupalGet('admin/config/content/formats/' . $format_id);
     $this->drupalPost(NULL, array(), t('Save configuration'));
 
-    // Disable text format.
+    // Verify that the custom weight of the text format has been retained.
     $this->drupalGet('admin/config/content/formats');
+    $this->assertFieldByName("formats[$format_id][weight]", 5, t('Text format weight was retained.'));
+
+    // Disable text format.
     $this->assertLinkByHref('admin/config/content/formats/' . $format_id . '/disable');
     $this->drupalGet('admin/config/content/formats/' . $format_id . '/disable');
     $this->drupalPost(NULL, array(), t('Disable'));
