X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Flayout_builder%2Fsrc%2FEntity%2FLayoutBuilderEntityViewDisplay.php;fp=web%2Fcore%2Fmodules%2Flayout_builder%2Fsrc%2FEntity%2FLayoutBuilderEntityViewDisplay.php;h=7f10d6f51f9c186490989115e28f137768f04195;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hp=0118768f77b776d8ddda9f1adb48f580dd845114;hpb=9424afc6c1f518c301bf87a23c047d1873435d05;p=yaffs-website diff --git a/web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php b/web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php index 0118768f7..7f10d6f51 100644 --- a/web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php +++ b/web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplay.php @@ -9,6 +9,7 @@ use Drupal\Core\Plugin\Context\EntityContext; use Drupal\Core\StringTranslation\TranslatableMarkup; use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldStorageConfig; +use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage; use Drupal\layout_builder\Section; use Drupal\layout_builder\SectionComponent; use Drupal\layout_builder\SectionStorage\SectionStorageTrait; @@ -110,10 +111,10 @@ class LayoutBuilderEntityViewDisplay extends BaseEntityViewDisplay implements La $bundle = $this->getTargetBundle(); if ($new_value) { - $this->addSectionField($entity_type_id, $bundle, 'layout_builder__layout'); + $this->addSectionField($entity_type_id, $bundle, OverridesSectionStorage::FIELD_NAME); } else { - $this->removeSectionField($entity_type_id, $bundle, 'layout_builder__layout'); + $this->removeSectionField($entity_type_id, $bundle, OverridesSectionStorage::FIELD_NAME); } } @@ -274,8 +275,8 @@ class LayoutBuilderEntityViewDisplay extends BaseEntityViewDisplay implements La * The sections. */ protected function getRuntimeSections(FieldableEntityInterface $entity) { - if ($this->isOverridable() && !$entity->get('layout_builder__layout')->isEmpty()) { - return $entity->get('layout_builder__layout')->getSections(); + if ($this->isOverridable() && !$entity->get(OverridesSectionStorage::FIELD_NAME)->isEmpty()) { + return $entity->get(OverridesSectionStorage::FIELD_NAME)->getSections(); } return $this->getSections();