Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.429
diff -u -p -r1.429 menu.inc
--- includes/menu.inc	17 Dec 2010 01:08:15 -0000	1.429
+++ includes/menu.inc	23 Dec 2010 03:43:56 -0000
@@ -2317,12 +2317,13 @@ 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).
+    // Needs to be done even if the current page isn't shown in the breadcrumb,
+    // because otherwise page title is set to 'Home'.
+    // Exclude it if we are on the front page.
     $last = end($trail);
-    if ($last['href'] != $preferred_link['href'] && ($preferred_link['type'] & MENU_VISIBLE_IN_BREADCRUMB) == MENU_VISIBLE_IN_BREADCRUMB && !drupal_is_front_page()) {
-      $trail[] = $preferred_link;
+    if ($last['href'] != $current_item['href'] && !drupal_is_front_page()) {
+      $trail[] = $current_item;
     }
   }
   return $trail;
@@ -2407,7 +2408,19 @@ function menu_link_get_preferred($path =
     }
   }
 
-  return $preferred_links[$path];
+  if (!empty($preferred_links[$path])) {
+    return $preferred_links[$path];
+  }
+  else {
+    // If no links found, recursively call function after peeling off the last
+    // element of the path.
+    $path_elems = explode('/', $path);
+    array_pop($path_elems);
+    if (!count($path_elems))
+      return $preferred_links[$path];
+    $newpath = implode('/', $path_elems);
+    return menu_link_get_preferred($newpath);
+  }
 }
 
 /**
