By wim leers on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.0.x
Introduced in version:
8.0.0-BETA11
Issue links:
Description:
- API break:
MenuLinkTreeElement::accessmust now be NULL or anAccessResultInterfaceobject, it used to be either NULL or a boolean. - API addition:
MenuParentFormSelectorInterface::getParentSelectOptions()has gained a new optional parameter. - API addition:
Element::isEmpty()
Practically
DefaultMenuLinkTreeManipulators::checkAccess()now sets anAccessResultobject (which implements bothAccessResultInterfaceandCacheableDependencyInterface). This ensures that the final menu tree contains all the necessary cacheability metadata during rendering.MenuLinkTree::build()now tracks the cacheability metadata of both access results and the links it renders, and then applies that cacheability metadata to the the render array it returns. The cacheability of rendered URLs is taken care of inmenu.html.twig, becauseMenuLinkTree::build()does not actually render URLs, the Twig template does.MenuLinkTree::build()just figures out *which* links to render.
This means that any code that was transforming a menu link tree, and included an access-checking menu link tree manipulator, and manually rendered (i.e. not using MenuLinkTree::build()) the end result, must now perform access checking in that manual rendering.
Similarly, if you had written any custom menu link tree manipulator that performed access checking, it must now no longer set booleans, but AccessResultInterface objects.
Impacts:
Module developers