From 9824d7ac2502bb63501f53df24b8f17d18b2a242 Mon Sep 17 00:00:00 2001 From: webchick Date: Thu, 12 Apr 2012 00:23:01 -0700 Subject: Issue #918356 by David_Rothstein, franz, tekante, dstol, mikestefff: Fixed WSOD when drupal_get_title() called during hook_init() and custom 403 or 404 pages are being used. --- includes/menu.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'includes/menu.inc') diff --git a/includes/menu.inc b/includes/menu.inc index 15978a32a..5c294c111 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -2313,6 +2313,9 @@ function menu_get_active_menu_names() { */ function menu_set_active_item($path) { $_GET['q'] = $path; + // Since the active item has changed, the active menu trail may also be out + // of date. + drupal_static_reset('menu_set_active_trail'); } /** @@ -2398,7 +2401,7 @@ function menu_set_active_trail($new_trail = NULL) { // appending either the preferred link or the menu router item for the // current page. Exclude it if we are on the front page. $last = end($trail); - if ($last['href'] != $preferred_link['href'] && !drupal_is_front_page()) { + if ($preferred_link && $last['href'] != $preferred_link['href'] && !drupal_is_front_page()) { $trail[] = $preferred_link; } } -- cgit v1.2.3