By tim.plunkett on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.7.x
Introduced in version:
8.7.0-alpha1
Issue links:
Description:
\Drupal\layout_builder\SectionStorage\SectionStorageManagerInterface::findByContext() now calls a new method when determining which section storage plugin to return.
Previously it would call ::access() and pass through an arbitrary $operation string.
Now it will call the new ::isApplicable().
The allows SectionStorage plugins to keep their ::access() method strictly related to access checking.
All implementations of ::isApplicable() must populate the $cacheability object with any relevant information used when determining the return value.
For example, if the property of an entity is used:
public function isApplicable(RefinableCacheableDependencyInterface $cacheability) {
$entity = $this->getEntity();
$cacheability->addCacheableDependency($entity);
return $entity->isThisGood();
}