By larowlan on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
11.2.x
Introduced in version:
11.2.0
Issue links:
Description:
Before
Calling \Drupal\Core\Cache\RefinableCacheableDependencyTrait::addCacheableDependency with an object that did not implement \Drupal\Core\Cache\CacheableDependencyInterface would result in the page being uncacheable (max-age 0).
This is rarely what the developer intended. There are other ways to mark a page as uncacheable (e.g setting max-age to 0 explicitly)
After
In 12.0.0, the method \Drupal\Core\Cache\RefinableCacheableDependencyTrait::addCacheableDependency will be have a type hint of \Drupal\Core\Cache\CacheableDependencyInterface for the argument.
public function addCacheableDependency(CacheableDependencyInterface $other_object) {
Impacts:
Module developers