X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Flayout_builder%2Fsrc%2FLayoutEntityHelperTrait.php;h=fc22168a99e5fb0afb6824c048944b0edaf6b473;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hp=9124027542ef13cfdba94f2b30775032e1ea0311;hpb=0bf8d09d2542548982e81a441b1f16e75873a04f;p=yaffs-website diff --git a/web/core/modules/layout_builder/src/LayoutEntityHelperTrait.php b/web/core/modules/layout_builder/src/LayoutEntityHelperTrait.php index 912402754..fc22168a9 100644 --- a/web/core/modules/layout_builder/src/LayoutEntityHelperTrait.php +++ b/web/core/modules/layout_builder/src/LayoutEntityHelperTrait.php @@ -6,6 +6,7 @@ use Drupal\Component\Plugin\DerivativeInspectionInterface; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Entity\FieldableEntityInterface; use Drupal\layout_builder\Entity\LayoutEntityDisplayInterface; +use Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage; /** * Methods to help with entities using the layout builder. @@ -65,7 +66,7 @@ trait LayoutEntityHelperTrait { return $entity->getSections(); } elseif ($this->isEntityUsingFieldOverride($entity)) { - return $entity->get('layout_builder__layout')->getSections(); + return $entity->get(OverridesSectionStorage::FIELD_NAME)->getSections(); } return NULL; } @@ -102,7 +103,7 @@ trait LayoutEntityHelperTrait { * TRUE if the entity is using a field for a layout override. */ protected function isEntityUsingFieldOverride(EntityInterface $entity) { - return $entity instanceof FieldableEntityInterface && $entity->hasField('layout_builder__layout'); + return $entity instanceof FieldableEntityInterface && $entity->hasField(OverridesSectionStorage::FIELD_NAME); } }