Skip to content
Snippets Groups Projects
Commit a1537c3e authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #266596 by pwolanin: menu system performance improvement.

parent aa8c6466
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -623,7 +623,10 @@ function _menu_translate(&$router_item, $map, $to_arg = FALSE) { ...@@ -623,7 +623,10 @@ function _menu_translate(&$router_item, $map, $to_arg = FALSE) {
$router_item['options'] = array(); $router_item['options'] = array();
_menu_check_access($router_item, $map); _menu_check_access($router_item, $map);
// For performance, don't localize an item the user can't access.
if ($router_item['access']) {
_menu_item_localize($router_item, $map); _menu_item_localize($router_item, $map);
}
return $map; return $map;
} }
...@@ -701,9 +704,11 @@ function _menu_link_translate(&$item) { ...@@ -701,9 +704,11 @@ function _menu_link_translate(&$item) {
} }
_menu_check_access($item, $map); _menu_check_access($item, $map);
} }
// For performance, don't localize a link the user can't access.
if ($item['access']) {
_menu_item_localize($item, $map, TRUE); _menu_item_localize($item, $map, TRUE);
} }
}
// Allow other customizations - e.g. adding a page-specific query string to the // Allow other customizations - e.g. adding a page-specific query string to the
// options array. For performance reasons we only invoke this hook if the link // options array. For performance reasons we only invoke this hook if the link
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment