Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.428
diff -u -p -r1.428 menu.inc
--- includes/menu.inc	8 Dec 2010 06:48:39 -0000	1.428
+++ includes/menu.inc	28 Dec 2010 06:04:05 -0000
@@ -2303,11 +2303,18 @@ function menu_set_active_trail($new_trai
       }
       list($key, $curr) = each($tree);
     }
-    // Make sure the current page is in the trail (needed for the page title),
-    // if the link's type allows it to be shown in the breadcrumb. Also exclude
-    // it if we are on the front page.
+    // Make sure the current page is in the trail (needed for the page title)
+    // The title for a page is determined by taking the last item in the active
+    // path which is not a local task. The active path is seeded with a link to
+    // home and each item in the path with type MENU_VISIBLE_IN_BREADCRUMB is
+    // added to the list. At the end of this process the preferred link for the
+    // current item is added to the end of the breadcrumb if it is not of type
+    // MENU_LOCAL_TASK. Adding the preferred link to the breadcrumb trail even
+    // if it is only a MENU_CALLBACK does not have an adverse affect on the
+    // breadcrumbs as the current page is always dropped from the breadcrumb
+    // trail anyway.
     $last = end($trail);
-    if ($last['href'] != $preferred_link['href'] && ($preferred_link['type'] & MENU_VISIBLE_IN_BREADCRUMB) == MENU_VISIBLE_IN_BREADCRUMB && !drupal_is_front_page()) {
+    if ($last['href'] != $preferred_link['href'] && !drupal_is_front_page()) {
       $trail[] = $preferred_link;
     }
   }
Index: modules/simpletest/tests/menu.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/menu.test,v
retrieving revision 1.42
diff -u -p -r1.42 menu.test
--- modules/simpletest/tests/menu.test	2 Dec 2010 17:34:24 -0000	1.42
+++ modules/simpletest/tests/menu.test	28 Dec 2010 06:04:07 -0000
@@ -33,6 +33,14 @@ class MenuRouterTestCase extends DrupalW
     $this->assertText('A title with @placeholder', t('Raw text found on the page'));
     $this->assertNoText(t('A title with @placeholder', array('@placeholder' => 'some other text')), t('Text with placeholder substitutions not found.'));
   }
+  
+  /**
+   * Tests page title of MENU_CALLBACKs.
+   */
+  function testTitleMenuCallback() {
+    $this->drupalGet('menu_callback_title');
+    $this->assertText(t('Menu Callback Title'));
+  }
 
   /**
    * Test the theme callback when it is set to use an administrative theme.
Index: modules/simpletest/tests/menu_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/menu_test.module,v
retrieving revision 1.21
diff -u -p -r1.21 menu_test.module
--- modules/simpletest/tests/menu_test.module	2 Dec 2010 17:34:24 -0000	1.21
+++ modules/simpletest/tests/menu_test.module	28 Dec 2010 06:04:08 -0000
@@ -16,6 +16,12 @@ function menu_test_menu() {
     'page callback' => 'node_save',
     'menu_name' => menu_test_menu_name(),
   );
+  // This item is of type MENU_CALLBACK with no parents to test title.
+  $items['menu_callback_title'] = array(
+    'title' => 'Menu Callback Title',
+    'page callback' => 'menu_test_callback',
+    'access arguments' => array('access content'),
+  );
   // Use FALSE as 'title callback' to bypass t().
   $items['menu_no_title_callback'] = array(
     'title' => 'A title with @placeholder',
