Problem/Motivation
Having the following menu tree:
- item 1 (disabled) -- item 1a -- item 2a - item 2 -- item 2a - item 3
Then fetch the full menu tree with only enabled menu items:
$parameters = new MenuTreeParameters();
$parameters->onlyEnabledLinks();
$tree = \Drupal::service('menu.link_tree')->load($menu_name, $parameters);
I expect to get the following tree:
- item 2 -- item 2a - item 3
Instead I get:
- item 1a -- item 2a - item 2 -- item 2a - item 3
Proposed resolution
Don't add enabled subtree items to the tree when the parent item is disabled and the menu tree is build with the "onlyEnabledLinks" parameter set.