From 2e62367ce38c9beb7c5773377683620ecb4aa549 Mon Sep 17 00:00:00 2001 From: xjm Date: Mon, 9 Nov 2015 15:36:21 -0600 Subject: [PATCH] Issue #2609114 by rakesh.gectcr, chx, dawehner, tim.plunkett: Unused variable in LocalTaskManager class --- core/lib/Drupal/Core/Menu/LocalTaskManager.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/lib/Drupal/Core/Menu/LocalTaskManager.php b/core/lib/Drupal/Core/Menu/LocalTaskManager.php index 512ccfea985..1791efebe3b 100644 --- a/core/lib/Drupal/Core/Menu/LocalTaskManager.php +++ b/core/lib/Drupal/Core/Menu/LocalTaskManager.php @@ -304,7 +304,9 @@ class LocalTaskManager extends DefaultPluginManager implements LocalTaskManagerI } // Pre-fetch all routes involved in the tree. This reduces the number // of SQL queries that would otherwise be triggered by the access manager. - $routes = $route_names ? $this->routeProvider->getRoutesByNames($route_names) : array(); + if ($route_names) { + $this->routeProvider->getRoutesByNames($route_names); + } foreach ($tree as $level => $instances) { /** @var $instances \Drupal\Core\Menu\LocalTaskInterface[] */