=== modified file 'includes/menu.inc'
--- includes/menu.inc	2009-06-10 21:52:36 +0000
+++ includes/menu.inc	2009-06-29 03:45:58 +0000
@@ -1443,22 +1443,22 @@ function menu_navigation_links($menu_nam
  *
  * @param $level
  *   The level of tasks you ask for. Primary tasks are 0, secondary are 1.
- * @param $return_root
- *   Whether to return the root path for the current page.
+ * @param $return_rendered
+ *   Whether to return an HTML string or a structure.
  * @return
  *   Themed output corresponding to the tabs of the requested level, or
  *   router path if $return_root == TRUE. This router path corresponds to
  *   a parent tab, if the current page is a default local task.
  */
-function menu_local_tasks($level = 0, $return_root = FALSE) {
+function menu_local_tasks($level = 0, $rendered = TRUE) {
   $tabs = &drupal_static(__FUNCTION__);
-  $root_path = &drupal_static(__FUNCTION__ . ':root_path');
+  $structured_tabs = &drupal_static(__FUNCTION__ . ':structured_tabs');
 
   if (!isset($tabs)) {
     $tabs = array();
 
     $router_item = menu_get_item();
-    if (!$router_item || !$router_item['access']) {
+    if ($rendered && (!$router_item || !$router_item['access'])) {
       return '';
     }
     // Get all tabs and the root page.
@@ -1471,7 +1471,7 @@ function menu_local_tasks($level = 0, $r
     $map = arg();
     $children = array();
     $tasks = array();
-    $root_path = $router_item['path'];
+    $structured_tabs = array();
 
     foreach ($result as $item) {
       _menu_translate($item, $map, TRUE);
@@ -1494,19 +1494,20 @@ function menu_local_tasks($level = 0, $r
       $count = 0;
       foreach ($children[$path] as $item) {
         if ($item['access']) {
-          $count++;
+          $default = FALSE;
+          $structured_tabs[$depth][$count] = $item;
           // The default task is always active.
           if ($item['type'] == MENU_DEFAULT_LOCAL_TASK) {
             // Find the first parent which is not a default local task.
             for ($p = $item['tab_parent']; $tasks[$p]['type'] == MENU_DEFAULT_LOCAL_TASK; $p = $tasks[$p]['tab_parent']);
-            $link = theme('menu_item_link', array('href' => $tasks[$p]['href']) + $item);
-            $tabs_current .= theme('menu_local_task', $link, TRUE);
+            $structured_tabs[$depth][$count]['href'] = $tasks[$p]['href'];
+            $structured_tabs[$depth][$count]['description'] = $tasks[$p]['description'];
+            $default = TRUE;
             $next_path = $item['path'];
           }
-          else {
-            $link = theme('menu_item_link', $item);
-            $tabs_current .= theme('menu_local_task', $link);
-          }
+          $link = theme('menu_item_link', $structured_tabs[$depth][$count]);
+          $tabs_current .= theme('menu_local_task', $link, $default);
+          $count++;
         }
       }
       $path = $next_path;
@@ -1527,18 +1528,15 @@ function menu_local_tasks($level = 0, $r
       $count = 0;
       foreach ($children[$parent] as $item) {
         if ($item['access']) {
-          $count++;
+          $structured_tabs[$depth][$count] = $item;
           if ($item['type'] == MENU_DEFAULT_LOCAL_TASK) {
             // Find the first parent which is not a default local task.
             for ($p = $item['tab_parent']; $tasks[$p]['type'] == MENU_DEFAULT_LOCAL_TASK; $p = $tasks[$p]['tab_parent']);
-            $link = theme('menu_item_link', array('href' => $tasks[$p]['href']) + $item);
-            if ($item['path'] == $router_item['path']) {
-              $root_path = $tasks[$p]['path'];
-            }
-          }
-          else {
-            $link = theme('menu_item_link', $item);
+            $structured_tabs[$depth][$count]['href'] = $tasks[$p]['href'];
+            $structured_tabs[$depth][$count]['description'] = $tasks[$p]['description'];
           }
+          $link = theme('menu_item_link', $structured_tabs[$depth][$count]);
+          $count++;
           // We check for the active tab.
           if ($item['path'] == $path) {
             $tabs_current .= theme('menu_local_task', $link, TRUE);
@@ -1558,19 +1556,22 @@ function menu_local_tasks($level = 0, $r
       $tabs[$depth]['output'] = $tabs_current;
       $depth--;
     }
+
     // Sort by depth.
     ksort($tabs);
+    ksort($structured_tabs);
     // Remove the depth, we are interested only in their relative placement.
     $tabs = array_values($tabs);
+    $structured_tabs = array_values($structured_tabs);
   }
 
-  if ($return_root) {
-    return $root_path;
-  }
-  else {
+  if ($rendered) {
     // We do not display single tabs.
     return (isset($tabs[$level]) && $tabs[$level]['count'] > 1) ? $tabs[$level]['output'] : '';
   }
+  else {
+    return isset($level) && isset($structured_tabs[$level]) ? $structured_tabs[$level] : $structured_tabs;
+  }
 }
 
 /**
@@ -1591,7 +1592,40 @@ function menu_secondary_local_tasks() {
  * Returns the router path, or the path of the parent tab of a default local task.
  */
 function menu_tab_root_path() {
-  return menu_local_tasks(0, TRUE);
+  $item = menu_tab_root_item();
+  return $item['href'];
+}
+
+/**
+ * Returns the root tab item.
+ *
+ * This can either be the parent of a default local task or the current item.
+ */
+function menu_tab_root_item() {
+  if ($items = menu_local_tasks(0, FALSE)) {
+    return $items[0];
+  }
+  return menu_get_item();
+}
+
+/**
+ * Returns the root tab item for a given path.
+ *
+ * This can either be the parent of a default local task or the current item.
+ */
+function menu_tab_root_item_by_path($path) {
+  static $root_item;
+  if (!isset($root_item)) {
+    // There is a possible infinite loop here because for eg. system blocks are
+    // access checked by filling out the block.
+    $root_item = FALSE;
+    $saved_item = menu_get_item();
+    menu_set_item(NULL, menu_get_item($path));
+    $root_item = menu_tab_root_item();
+    drupal_static_reset('menu_local_tasks');
+    menu_set_item(NULL, $saved_item);
+  }
+  return $root_item;
 }
 
 /**

=== modified file 'modules/comment/comment.module'
--- modules/comment/comment.module	2009-06-27 10:13:28 +0000
+++ modules/comment/comment.module	2009-06-29 03:46:57 +0000
@@ -159,6 +159,12 @@ function comment_theme() {
  * Implement hook_menu().
  */
 function comment_menu() {
+  $items['admin/content/%comment_admin'] = array(
+    'title callback' => 'comment_admin_title',
+    // This works because both every string (but '0') is == TRUE.
+    'access callback' => 'comment_admin_to_arg',
+    'options' => array('alter' => TRUE),
+  );
   $items['admin/content/content/comment'] = array(
     'title' => 'Comments',
     'description' => 'List and edit site comments and the comment approval queue.',
@@ -217,6 +223,40 @@ function comment_menu() {
 }
 
 /**
+ * Title callback for admin/content/%.
+ */
+function comment_admin_title() {
+  $root_item = menu_tab_root_item_by_path('admin/content/content');
+  return $root_item['title'];
+}
+
+/**
+ * To_arg and access callback for admin/content/%.
+ */
+function comment_admin_to_arg() {
+  $root_item = menu_tab_root_item_by_path('admin/content/content');
+  return substr($root_item['href'], 14);  
+}
+
+/**
+ * Implement hook_translated_menu_link_alter.
+ */
+function comment_translated_menu_link_alter(&$link) {
+  if ($link['link_path'] == 'admin/content/%' && ($root_item = menu_tab_root_item_by_path('admin/content/content'))) {
+    $link['description'] = $root_item['description'];
+  }
+}
+
+/**
+ * Implement hook_menu_alter().
+ */
+function comment_menu_alter(&$items) {
+  // Add comments to the description for admin/content/content and hide it.                                                                       
+  $items['admin/content/content']['description'] = "View, edit, and delete your site's content and comments.";          
+  $items['admin/content/content']['type'] = MENU_CALLBACK;
+}
+
+/**
  * Implement hook_node_type().
  */
 function comment_node_type($op, $info) {
@@ -2410,11 +2450,3 @@ function comment_ranking() {
     ),
   );
 }
-
-/**
- * Implement hook_menu_alter().
- */
-function comment_menu_alter(&$items) {
-  // Add comments to the description for admin/content/content.
-  $items['admin/content/content']['description'] = "View, edit, and delete your site's content and comments.";
-}

=== modified file 'modules/comment/comment.test'
--- modules/comment/comment.test	2009-06-27 10:13:28 +0000
+++ modules/comment/comment.test	2009-06-29 03:38:28 +0000
@@ -552,7 +552,7 @@ class CommentPagerTest extends CommentHe
   }
 }
 
-class CommentApprovalTest extends CommentHelperCase {
+class CommentAdminTestCase extends CommentHelperCase {
   public static function getInfo() {
     return array(
       'name' => t('Comment approval'),
@@ -562,6 +562,24 @@ class CommentApprovalTest extends Commen
   }
 
   /**
+   * Test integration with content administration.
+   */
+  function testCommentAdmin() {
+    $comment_admin = $this->drupalCreateUser(array('administer comments', 'access administration pages'));
+    $this->drupalLogin($comment_admin);
+    $this->drupalGet('admin');
+    $this->clickLink(t('Comments'));
+    $this->assertResponse(200, t('Comments administration link is shown and works.'));
+
+    $content_admin = $this->drupalCreateUser(array('access administration pages', 'administer comments', 'administer nodes'));
+    $this->drupalLogin($content_admin);
+    $this->drupalGet('admin');
+    $this->assertText(t("View, edit, and delete your site's content and comments."), t('Content administration is shown.'));
+    $this->clickLink(t('Content'));
+    $this->assertResponse(200, t('Content admin page loaded'));
+  }
+
+  /**
    * Test comment approval functionality through admin/content/content/comment.
    */
   function testApprovalAdminInterface() {

