diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/menu.inc | 5 |
1 files changed, 4 insertions, 1 deletions
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; } } |