From 84e8f30a17c99d9392ea890213a4d3f9631e6fbe Mon Sep 17 00:00:00 2001
From: Timo Tiuraniemi <timo.tiuraniemi@iki.fi>
Date: Wed, 6 Jun 2012 10:25:00 +0300
Subject: [PATCH] Fixed class active-trail not added to <li> when linking 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..0a788a1 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

