diff --git a/core/modules/layout_builder/layout_builder.module b/core/modules/layout_builder/layout_builder.module index 8abe4a4a4f..e83452683b 100644 --- a/core/modules/layout_builder/layout_builder.module +++ b/core/modules/layout_builder/layout_builder.module @@ -208,9 +208,10 @@ function layout_builder_block_content_access(EntityInterface $entity, $operation * Implements hook_layout_builder_section_storage_alter(). */ function layout_builder_layout_builder_section_storage_alter(array &$definitions) { - // The \Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage - // plugin defines the entity context via its annotation but cannot specify the - // constraint inline. + // @todo Until https://www.drupal.org/node/3016420 is resolved, context + // definition annotations cannot specify any constraints. Alter + // \Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage to + // add the constraint of having the required layout field. /** @var \Drupal\layout_builder\SectionStorage\SectionStorageDefinition[] $definitions */ $definitions['overrides']->getContextDefinition('entity') ->addConstraint('EntityHasField', OverridesSectionStorage::FIELD_NAME); diff --git a/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php b/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php index 5fc365a7dc..526a04f355 100644 --- a/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php +++ b/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php @@ -4,7 +4,6 @@ use Drupal\Core\Entity\Entity\EntityViewDisplay as BaseEntityViewDisplay; use Drupal\Core\Entity\EntityStorageInterface; -use Drupal\Core\Entity\FieldableEntityInterface; use Drupal\Core\Plugin\Context\Context; use Drupal\Core\Plugin\Context\ContextDefinition; use Drupal\Core\Plugin\Context\EntityContext; diff --git a/core/modules/layout_builder/src/SectionStorageInterface.php b/core/modules/layout_builder/src/SectionStorageInterface.php index 0358778b15..185f92f9b1 100644 --- a/core/modules/layout_builder/src/SectionStorageInterface.php +++ b/core/modules/layout_builder/src/SectionStorageInterface.php @@ -63,6 +63,8 @@ public function buildRoutes(RouteCollection $collection); * * @return \Drupal\Core\Plugin\Context\ContextInterface[] * The available plugin contexts. + * + * @see \Drupal\Core\ParamConverter\ParamConverterInterface::convert() */ public function deriveContextsFromRoute($value, $definition, $name, array $defaults);