Commit a7e64245 authored by catch's avatar catch

Issue #2078583 by dawehner, pwolanin: Fixed menu callbacks removed from...

Issue #2078583 by dawehner, pwolanin: Fixed menu callbacks removed from hook_menu() do not display any menus.
parent 258d14ea
......@@ -1278,8 +1278,14 @@ function menu_tree_page_data($menu_name, $max_depth = NULL, $only_active_trail =
// Load the router item corresponding to the current page.
$request = \Drupal::request();
$system_path = NULL;
if ($route_name = $request->attributes->get(RouteObjectInterface::ROUTE_NAME)) {
// @todo https://drupal.org/node/2068471 is adding support so we can tell
// if this is called on a 404/403 page.
$system_path = $request->attributes->get('_system_path');
$page_not_403 = 1;
}
// @todo Remove once the old router system is removed.
if ($request->attributes->has('_legacy')) {
elseif ($request->attributes->has('_legacy')) {
// Page is a 404 if no item is loaded.
if ($item = menu_get_item($active_path)) {
$system_path = $item['href'];
......@@ -1288,12 +1294,6 @@ function menu_tree_page_data($menu_name, $max_depth = NULL, $only_active_trail =
$page_not_403 = (int) $item['access'];
}
}
elseif ($route_name = $request->attributes->get(RouteObjectInterface::ROUTE_NAME)) {
// @todo https://drupal.org/node/2068471 is adding support so we can tell
// if this is called on a 404/403 page.
$system_path = $request->attributes->get('_system_path');
$page_not_403 = 1;
}
if (isset($system_path)) {
if (isset($max_depth)) {
$max_depth = min($max_depth, MENU_MAX_DEPTH);
......
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