public function overview($link_id) { // Check for status report errors.
if ($this->
currentUser()->
hasPermission('administer site configuration'
) &&
$this->systemManager->
checkRequirements()) { $this->
messenger()->
addError($this->
t('One or more problems were detected with your Drupal installation. Check the <a href=":status">status report</a> for more information.',
[':status' => Url::
fromRoute('system.status'
)->
toString()]));
} // Load all menu links below it.
$parameters =
new MenuTreeParameters();
$parameters->
setRoot($link_id)->
excludeRoot()->
setTopLevelOnly()->
onlyEnabledLinks();
$tree =
$this->menuLinkTree->
load(NULL,
$parameters);
$manipulators =
[ ['callable' => 'menu.default_tree_manipulators:checkAccess'
],
['callable' => 'menu.default_tree_manipulators:generateIndexAndSort'
],
];
$tree =
$this->menuLinkTree->
transform($tree,
$manipulators);
$tree_access_cacheability =
new CacheableMetadata();
$blocks =
[];
foreach ($tree as $key =>
$element) { $tree_access_cacheability =
$tree_access_cacheability->
merge(CacheableMetadata::
createFromObject($element->access
));