- Issue created by @SocialNicheGuru
- πΊπΈUnited States Chris Burge
It looks like we need to check if
$third_party_settings['sections']
is set?// Loop through entity view displays, sections, and components. foreach ($view_displays as $display) { if (!$display instanceof LayoutBuilderEntityViewDisplay) { continue; } if ($display->isLayoutBuilderEnabled()) { $third_party_settings = $display->getThirdPartySettings('layout_builder'); // Only track the entity type if overrides are enabled. if ($display->isOverridable()) { $lb_entity_types[] = $display->getTargetEntityTypeId(); } foreach ($third_party_settings['sections'] as $section) { // <-- HERE $components = $section->getComponents(); foreach ($components as $component) { // Remove 'component_attributes' from 'additional'. $additional = $component->get('additional'); unset($additional['component_attributes']); $component->set('additional', $additional); } } $display ->setThirdPartySetting('layout_builder', 'sections', $third_party_settings['sections']) ->save(); } }