Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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-BETA13
Issue links:
Description:
Since https://www.drupal.org/node/2337377, access results are value objects that may contain cacheability metadata.
The render system allows subtrees to be hidden using #access
.
Until this change, #access
could only be a boolean, which meant you had to manually map an AccessResultInterface
object to a boolean and merge the cacheability metadata. This is too easy to forget. And too cumbersome. Therefore, #access
now accepts AccessResultInterface
objects and automatically merges its cacheability metadata.
Impacts:
Module developers