diff --git a/core/modules/menu_link/lib/Drupal/menu_link/MenuTree.php b/core/modules/menu_link/lib/Drupal/menu_link/MenuTree.php index bc62399..8605a33 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/MenuTree.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuTree.php @@ -87,7 +87,7 @@ class MenuTree implements MenuTreeInterface { protected $menuOutput; /** - * Stores the menu menu tree keyed by a cache ID. + * Stores the menu tree used by the doBuildTree method, keyed by a cache ID. * * This cache ID is built using the $menu_name, the current language and * some parameters passed into an entity query. @@ -97,6 +97,9 @@ class MenuTree implements MenuTreeInterface { /** * Stores the full menu tree data keyed by a cache ID. * + * This variable distinct from static::$menuTree by having also items without + * access by the current user. + * * This cache ID is built with the menu name, a passed in root link ID, the * current language as well as the maximum depth. * @@ -157,7 +160,7 @@ public function buildAllData($menu_name, $link = NULL, $max_depth = NULL) { if (!isset($this->menuFullTrees[$cid])) { // If the static variable doesn't have the data, check {cache_menu}. $cache = $this->cache->get($cid); - if ($cache && isset($cache->data)) { + if ($cache && $cache->data) { // If the cache entry exists, it contains the parameters for // menu_build_tree(). $tree_parameters = $cache->data; @@ -233,7 +236,7 @@ public function buildPageData($menu_name, $max_depth = NULL, $only_active_trail if (!isset($this->menuPageTrees[$cid])) { // If the static variable doesn't have the data, check {cache_menu}. $cache = $this->cache->get($cid); - if ($cache && isset($cache->data)) { + if ($cache && $cache->data) { // If the cache entry exists, it contains the parameters for // menu_build_tree(). $tree_parameters = $cache->data; @@ -442,7 +445,7 @@ protected function doBuildTree($menu_name, array $parameters = array()) { // If we do not have this tree in the static cache, check {cache_menu}. if (!isset($this->menuTree[$tree_cid])) { $cache = $this->cache->get($tree_cid); - if ($cache && isset($cache->data)) { + if ($cache && $cache->data) { $this->menuFullTrees[$tree_cid] = $cache->data; } } diff --git a/core/modules/menu_link/lib/Drupal/menu_link/MenuTreeInterface.php b/core/modules/menu_link/lib/Drupal/menu_link/MenuTreeInterface.php index 0393e11..dd0b50e 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/MenuTreeInterface.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuTreeInterface.php @@ -34,8 +34,8 @@ public function renderTree($tree); * This path will also affect the breadcrumbs under some circumstances. * Breadcrumbs are built using the preferred link returned by * menu_link_get_preferred(). If the preferred link is inside one of the menus - * specified in calls to menu_tree_set_path(), the preferred link will be - * overridden by the corresponding path returned by menu_tree_get_path(). + * specified in calls to static::setPath(), the preferred link will be + * overridden by the corresponding path returned by static::getPath(). * * Setting this path does not affect the main content; for that use * menu_set_active_item() instead.