? drupal-breadcrumb-on-40x-pages-525314-11.patch
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1271
diff -u -p -r1.1271 common.inc
--- includes/common.inc	10 Dec 2010 16:44:53 -0000	1.1271
+++ includes/common.inc	10 Dec 2010 23:30:00 -0000
@@ -2457,6 +2457,8 @@ function drupal_deliver_html_page($page_
           // Standard 404 handler.
           drupal_set_title(t('Page not found'));
           $return = t('The requested page could not be found.');
+          $front = l(t('Home'), '<front>');
+          drupal_set_breadcrumb(array($front));
         }
 
         drupal_set_page_content($return);
@@ -2486,6 +2488,8 @@ function drupal_deliver_html_page($page_
           // Standard 403 handler.
           drupal_set_title(t('Access denied'));
           $return = t('You are not authorized to access this page.');
+          $front = l(t('Home'), '<front>');
+          drupal_set_breadcrumb(array($front));
         }
 
         print drupal_render_page($return);
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	10 Dec 2010 23:33:03 -0000
@@ -1320,18 +1320,27 @@ class MenuBreadcrumbTestCase extends Dru
     $this->drupalLogin($this->web_user);
 
     // Verify that we can access recent log entries, there is a corresponding
-    // page title, and that the breadcrumb is empty (because the user is not
-    // able to access "Administer", so the trail cannot recurse into it).
-    $trail = array();
+    // page title, and that the breadcrumb does not recurse into "Administer"
+    // because the user is not allowed to access it).
+    $trail = $home;
     $this->assertBreadcrumb('admin', $trail, t('Access denied'));
     $this->assertResponse(403);
 
-    $trail = $home;
     $this->assertBreadcrumb('admin/reports', $trail, t('Reports'));
     $this->assertNoResponse(403);
 
     $this->assertBreadcrumb('admin/reports/dblog', $trail, t('Recent log messages'));
     $this->assertNoResponse(403);
+
+    $this->drupalLogout();
+
+    // Verify that a minimal breadcrumb in included on the 403 & 404 page.
+    $trail = $home;
+    $this->assertBreadcrumb('admin', $trail, t('Access denied'));
+    $this->assertResponse(403);
+
+    $this->assertBreadcrumb($this->randomName(10), $trail, t('Page not found'));
+    $this->assertResponse(404);
   }
 
   /**
