Index: modules/node/node.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.admin.inc,v
retrieving revision 1.98
diff -u -p -r1.98 node.admin.inc
--- modules/node/node.admin.inc	30 Aug 2010 06:26:45 -0000	1.98
+++ modules/node/node.admin.inc	9 Sep 2010 11:10:13 -0000
@@ -460,6 +460,9 @@ function node_admin_nodes() {
   $languages = language_list();
   $destination = drupal_get_destination();
   $options = array();
+  // Define an explicit weight. As we key the nodes in $options by $node->nid,
+  // we lose the sorting from the initial query.
+  $weight = 0;
   foreach ($nodes as $node) {
     $l_options = $node->language != LANGUAGE_NONE && isset($languages[$node->language]) ? array('language' => $languages[$node->language]) : array();
     $options[$node->nid] = array(
@@ -476,6 +479,8 @@ function node_admin_nodes() {
       'author' => theme('username', array('account' => $node)),
       'status' => $node->status ? t('published') : t('not published'),
       'changed' => format_date($node->changed, 'short'),
+      // Keep the sorting from our initial query.
+      '#weight' => $weight++,
     );
     if ($multilanguage) {
       if ($node->language == LANGUAGE_NONE || isset($languages[$node->language])) {
Index: modules/node/node.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.test,v
retrieving revision 1.94
diff -u -p -r1.94 node.test
--- modules/node/node.test	30 Aug 2010 00:22:03 -0000	1.94
+++ modules/node/node.test	9 Sep 2010 11:10:14 -0000
@@ -1195,6 +1195,34 @@ class NodeAdminTestCase extends DrupalWe
   }
 
   /**
+   * Tests that the table sorting works on the content admin pages.
+   */
+  function testContentAdminSort() {
+    $this->drupalLogin($this->admin_user);
+    $nodes = array();
+    foreach (array('dd', 'aa', 'DD', 'bb', 'cc', 'CC', 'AA', 'BB') as $letters) {
+      $title = $letters . ' ' . $this->randomName(6);
+      $nodes[$this->drupalCreateNode(array('title' => $title))->nid] = $title;
+    }
+
+    // So, we need to compare the rendered html node list to a query for the nids,
+    // because who knows WTF the db will do with sorting, collation, case-insensitive
+    // sorts, etc. (I'm looking at you MYSQL.)
+    $query = db_select('node', 'n');
+    $nids_from_the_database = $query
+      ->fields('n',array('nid'))
+      ->orderBy('title')
+      ->execute()
+      ->fetchCol();
+
+    $this->drupalGet('admin/content', array('query' => array('sort' => 'asc', 'order' => 'Title')));
+    foreach ($this->xpath('//table/tbody/tr/td/div/input/@value') as $input) {
+      $nids_as_sorted_in_html[] = "$input";
+    }
+    $this->assertEqual($nids_from_the_database, $nids_as_sorted_in_html, "Nodes are sorted in the form the same as they are in the query.");
+  }
+
+  /**
    * Tests content overview with different user permissions.
    *
    * Taxonomy filters are tested separately.
