Commit 2f0e07fa authored by alexpott's avatar alexpott

Issue #2032311 by dawehner: Load all routes for local tasks via getRoutesByNames().

parent 50ae478f
......@@ -192,11 +192,22 @@ public function getLocalTasksForRoute($route_name) {
public function getTasksBuild($route_name) {
$tree = $this->getLocalTasksForRoute($route_name);
$build = array();
// Collect all route names.
$route_names = array();
foreach ($tree as $instances) {
foreach ($instances as $child) {
$route_names[] = $child->getRouteName();
}
}
// Fetches all routes involved in the tree.
$routes = $route_names ? $this->routeProvider->getRoutesByNames($route_names) : array();
foreach ($tree as $level => $instances) {
foreach ($instances as $child) {
$path = $this->getPath($child);
// Find out whether the user has access to the task.
$route = $this->routeProvider->getRouteByName($child->getRouteName());
$route = $routes[$child->getRouteName()];
$map = array();
// @todo - replace this call when we have a real service for it.
$access = menu_item_route_access($route, $path, $map);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment