Index: modules/simpletest/tests/menu.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/menu.test,v
retrieving revision 1.36
diff -u -p -r1.36 menu.test
--- modules/simpletest/tests/menu.test	1 Oct 2010 15:24:18 -0000	1.36
+++ modules/simpletest/tests/menu.test	2 Oct 2010 21:41:06 -0000
@@ -872,6 +872,7 @@ class MenuBreadcrumbTestCase extends Dru
     // Verify breadcrumb on front page.
     $this->assertBreadcrumb('<front>', array());
 
+    // Verify breadcrumb on user pages (without menu link).
     $trail = $home;
     $this->assertBreadcrumb('user', $trail, t('User account'));
     $this->assertBreadcrumb('user/' . $this->admin_user->uid, $trail, $this->admin_user->name);
@@ -882,9 +883,38 @@ class MenuBreadcrumbTestCase extends Dru
     );
     $this->assertBreadcrumb('user/' . $this->admin_user->uid . '/edit', $trail, $this->admin_user->name);
 
+    // Create a second user to verify breadcrumb on user pages again.
+    $this->web_user = $this->drupalCreateUser(array(
+      'administer users',
+      'access user profiles',
+    ));
+    $this->drupalLogin($this->web_user);
+
+    // Verify correct breadcrumb and page title when viewing another user's
+    // account (without menu link).
+    $trail = $home;
+    $this->assertBreadcrumb('user/' . $this->admin_user->uid, $trail, $this->admin_user->name);
+
+    // Verify correct breadcrumb and page title when viewing another user's
+    // account edit page (without menu link).
+    $trail += array(
+      'user/' . $this->admin_user->uid => $this->admin_user->name,
+    );
+    $this->assertBreadcrumb('user/' . $this->admin_user->uid . '/edit', $trail, $this->admin_user->name);
+
+    // Verify correct breadcrumb and page title when viewing own user account
+    // pages (without menu link).
+    $trail = $home;
+    $this->assertBreadcrumb('user/' . $this->web_user->uid, $trail, $this->web_user->name);
+    $trail += array(
+      'user/' . $this->web_user->uid => $this->web_user->name,
+    );
+    $this->assertBreadcrumb('user/' . $this->web_user->uid . '/edit', $trail, $this->web_user->name);
+
     // Add a Navigation menu links for 'user' and $this->admin_user.
     // Although it may be faster to manage these links via low-level API
     // functions, there's a lot that can go wrong in doing so.
+    $this->drupalLogin($this->admin_user);
     $edit = array(
       'link_title' => 'User',
       'link_path' => 'user',
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1204
diff -u -p -r1.1204 user.module
--- modules/user/user.module	24 Sep 2010 00:37:45 -0000	1.1204
+++ modules/user/user.module	2 Oct 2010 22:28:04 -0000
@@ -1519,16 +1519,12 @@ function user_menu() {
 
   // Registration and login pages.
   $items['user'] = array(
-    'title' => 'User account',
+    'title' => 'My account',
     'page callback' => 'user_page',
     'access callback' => TRUE,
-    // Edge-case: No menu links should be auto-generated for this and below
-    // items, which makes it a MENU_CALLBACK. However, this item's title is
-    // expected to appear on user login, register, and password pages, so we
-    // need to use MENU_VISIBLE_IN_BREADCRUMB to make
-    // menu_get_active_breadcrumb() account for it.
-    'type' => MENU_VISIBLE_IN_BREADCRUMB,
     'file' => 'user.pages.inc',
+    'weight' => -10,
+    'menu_name' => 'user-menu',
   );
 
   $items['user/login'] = array(
@@ -1568,6 +1564,9 @@ function user_menu() {
     'page callback' => 'user_logout',
     'weight' => 10,
     'menu_name' => 'user-menu',
+    // Ignore router path inheritance to make the Logout link appear on the
+    // top-level of the user menu by default.
+    'plid' => 0,
     'file' => 'user.pages.inc',
   );
 
@@ -1665,9 +1664,7 @@ function user_menu() {
     'weight' => -10,
   );
 
-  // Use %user_uid_only_optional here to avoid loading the full user for
-  // basic access checks.
-  $items['user/%user_uid_only_optional'] = array(
+  $items['user/%user'] = array(
     'title' => 'My account',
     'title callback' => 'user_page_title',
     'title arguments' => array(1),
@@ -1675,8 +1672,6 @@ function user_menu() {
     'page arguments' => array(1),
     'access callback' => 'user_view_access',
     'access arguments' => array(1),
-    'weight' => -10,
-    'menu_name' => 'user-menu',
   );
 
   $items['user/%user/view'] = array(
@@ -1797,26 +1792,6 @@ function user_admin_paths() {
 }
 
 /**
- * Load either a specified or the current user account.
- *
- * @param $uid
- *   An optional user ID of the user to load. If not provided, the current
- *   user's ID will be used.
- * @return
- *   A fully-loaded $user object upon successful user load, FALSE if user
- *   cannot be loaded.
- *
- * @see user_load()
- * @todo rethink the naming of this in Drupal 8.
- */
-function user_uid_optional_load($uid = NULL) {
-  if (!isset($uid)) {
-    $uid = $GLOBALS['user']->uid;
-  }
-  return user_load($uid);
-}
-
-/**
  * Return a user object after checking if any profile category in the path exists.
  */
 function user_category_load($uid, &$map, $index) {
@@ -1855,36 +1830,9 @@ function user_category_load($uid, &$map,
 }
 
 /**
- * Returns $arg or the user ID of the current user if $arg is '%' or empty.
- *
- * @todo rethink the naming of this in Drupal 8.
- */
-function user_uid_optional_to_arg($arg) {
-  // Give back the current user uid when called from eg. tracker, aka.
-  // with an empty arg. Also use the current user uid when called from
-  // the menu with a % for the current account link.
-  return empty($arg) || $arg == '%' ? $GLOBALS['user']->uid : $arg;
-}
-
-/**
- * Returns $arg or the user ID of the current user if $arg is '%' or empty.
- *
- * @todo rethink the naming of this in Drupal 8.
- */
-function user_uid_only_optional_to_arg($arg) {
-  return user_uid_optional_to_arg($arg);
-}
-
-/**
  * Menu item title callback - use the user name.
  */
-function user_page_title($uid) {
-  if ($GLOBALS['user']->uid == $uid) {
-    $account = $GLOBALS['user'];
-  }
-  else {
-    $account = user_load($uid);
-  }
+function user_page_title($account) {
   return is_object($account) ? format_username($account) : '';
 }
 
@@ -2359,10 +2307,9 @@ function user_delete_multiple(array $uid
 /**
  * Page callback wrapper for user_view().
  */
-function user_view_page($uid) {
+function user_view_page($account) {
   // An administrator may try to view a non-existent account,
   // so we give them a 404 (versus a 403 for non-admins).
-  $account = user_load($uid);
   return is_object($account) ? user_view($account) : MENU_NOT_FOUND;
 }
 
