From 8517ebc4618c0a10b3234a504189dc56326d9d06 Mon Sep 17 00:00:00 2001
From: Timo Tiuraniemi <timo.tiuraniemi@iki.fi>
Date: Tue, 15 May 2012 10:18:07 +0300
Subject: [PATCH] Fixed bug with missing active-trail in <li> for links to <front>

---
 includes/menu.inc |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/includes/menu.inc b/includes/menu.inc
index b25a374..57bfaf3 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -1563,8 +1563,10 @@ function _menu_tree_data(&$links, $parents, $depth) {
   $tree = array();
   while ($item = array_pop($links)) {
     // We need to determine if we're on the path to root so we can later build
-    // the correct active trail and breadcrumb.
-    $item['in_active_trail'] = in_array($item['mlid'], $parents);
+    // the correct active trail and breadcrumb. A special case is needed for
+    // links to <front>.
+    $item['in_active_trail'] = in_array($item['mlid'], $parents) 
+                              || (drupal_is_front_page() && $item['link_path'] == '<front>');
     // Add the current link to the tree.
     $tree[$item['mlid']] = array(
       'link' => $item,
-- 
1.7.3.4

