X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Flayout_builder%2Fsrc%2FEntity%2FLayoutBuilderEntityViewDisplayStorage.php;fp=web%2Fcore%2Fmodules%2Flayout_builder%2Fsrc%2FEntity%2FLayoutBuilderEntityViewDisplayStorage.php;h=e00a2b46306692c487d611cf297c971511f020a7;hp=e86df9daf840173346ee4fcbe86ea6e8182f19e0;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplayStorage.php b/web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplayStorage.php index e86df9daf..e00a2b463 100644 --- a/web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplayStorage.php +++ b/web/core/modules/layout_builder/src/Entity/LayoutBuilderEntityViewDisplayStorage.php @@ -5,7 +5,6 @@ namespace Drupal\layout_builder\Entity; use Drupal\Core\Config\Entity\ConfigEntityStorage; use Drupal\Core\Entity\EntityInterface; use Drupal\layout_builder\Section; -use Drupal\layout_builder\SectionComponent; /** * Provides storage for entity view display entities that have layouts. @@ -38,20 +37,7 @@ class LayoutBuilderEntityViewDisplayStorage extends ConfigEntityStorage { foreach ($records as $id => &$record) { if (!empty($record['third_party_settings']['layout_builder']['sections'])) { $sections = &$record['third_party_settings']['layout_builder']['sections']; - foreach ($sections as $section_delta => $section) { - $sections[$section_delta] = new Section( - $section['layout_id'], - $section['layout_settings'], - array_map(function (array $component) { - return (new SectionComponent( - $component['uuid'], - $component['region'], - $component['configuration'], - $component['additional'] - ))->setWeight($component['weight']); - }, $section['components']) - ); - } + $sections = array_map([Section::class, 'fromArray'], $sections); } } return parent::mapFromStorageRecords($records);