- Issue created by @leksat
The logic of RefinableCacheableDependencyTrait::addCacheableDependency()
has been updated in
#3232018: Trigger an error when using \Drupal\Core\Cache\RefinableCacheableDependencyTrait::addCacheableDependency with a non CacheableDependencyInterface object β
.
If the passed object is NOT an instance of CacheableDependencyInterface
Previous behavior: max-age
is set to 0
Future behavior: an exception is thrown
In order to get rid of the deprecation notice and preserve the old behavior, one bit of LayoutBuilderAccessCheck::access()
code was changed from
$access->addCacheableDependency($section_storage);
to
if ($section_storage instanceof CacheableDependencyInterface) {
$access->addCacheableDependency($section_storage);
}
else {
$access->setCacheMaxAge(0);
}
However, it was noticed that SimpleConfigSectionStorage
is the only class that does not implement CacheableDependencyInterface
.
Maybe SimpleConfigSectionStorage
should be extended to implement CacheableDependencyInterface
? Then the if
condition could be removed.
- Make a decision
- Update the code?
None
None
None
Active
11.0 π₯
Last updated