Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.417
diff -u -p -r1.417 menu.inc
--- includes/menu.inc	30 Oct 2010 04:13:38 -0000	1.417
+++ includes/menu.inc	7 Nov 2010 21:46:48 -0000
@@ -413,9 +413,7 @@ function menu_get_item($path = NULL, $ro
   }
   if (!isset($router_items[$path])) {
     $original_map = arg(NULL, $path);
-    $parts = array_slice($original_map, 0, MENU_MAX_PARTS);
-    $ancestors = menu_get_ancestors($parts);
-
+    
     // Since there is no limit to the length of $path, use a hash to keep it
     // short yet unique.
     $cid = 'menu_item:' . hash('sha256', $path);
@@ -423,6 +421,7 @@ function menu_get_item($path = NULL, $ro
       $router_item = $cached->data;
     }
     else {
+      $ancestors = menu_get_ancestors(array_slice($original_map, 0, MENU_MAX_PARTS));
       $router_item = db_query_range('SELECT * FROM {menu_router} WHERE path IN (:ancestors) ORDER BY fit DESC', 0, 1, array(':ancestors' => $ancestors))->fetchAssoc();
       cache_set($cid, $router_item, 'cache_menu');
     }
