From 16a7121c298356a65c5cd5ec1b963d0a4b2cab38 Mon Sep 17 00:00:00 2001
From: Sascha Grossenbacher <saschagros@gmail.com>
Date: Sun, 24 Apr 2011 17:55:55 +0200
Subject: [PATCH] Issue #1137052 by Berdir: Fixed argument map of parent router item is used when checking access for local tasks.

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

diff --git a/includes/menu.inc b/includes/menu.inc
index 2a8c80c..0daa5a7 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -1854,12 +1854,15 @@ function menu_local_tasks($level = 0) {
       ->orderBy('weight')
       ->orderBy('title')
       ->execute();
-    $map = $router_item['original_map'];
+    $original_map = $router_item['original_map'];
     $children = array();
     $tasks = array();
     $root_path = $router_item['path'];
 
     foreach ($result as $item) {
+      // Build the map for this local task, start with the original map and then
+      // append the additional local task path elements.
+      $map = array_merge($original_map, array_slice(arg(NULL, $item['path']), count($original_map)));
       _menu_translate($item, $map, TRUE);
       if ($item['tab_parent']) {
         // All tabs, but not the root page.
-- 
1.7.4.1

