Problem/Motivation

While working on #296693: Restrict access to empty top level administration pages I discover that \Drupal\Core\Menu\MenuLinkTree::load is sometimes sent NULL for the menu name, like in \Drupal\system\Controller\SystemController::overview, but it is not documented that this possible and what it means. \Drupal\Core\Menu\MenuLinkTreeInterface::load says it must be a string and the function definition does not have parameter type hint.

This also cascades into the methods it calls passing on the NULL when it is also documented that is acceptable value into

  1. \Drupal\Core\Menu\MenuTreeStorage::loadTreeData

Proposed resolution

Update the @param doc to specify that NULL is possible value and in what circumstances.

If we could add a ?string type hint that would also be great

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

tedbow created an issue. See original summary.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.