Skip to content

Commit

Permalink
fix: Fix error with specifying which sections get updated
Browse files Browse the repository at this point in the history
  • Loading branch information
codechefmarc committed Sep 14, 2023
1 parent 1daa987 commit c39bf80
Showing 1 changed file with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function updateExistingEventsLock() {
/** @var \Drupal\layout_builder\Field\LayoutSectionItemList $layout */
$sections = $layout->getSections();
foreach ($sections as $section) {
if ($section->getLayoutSettings()['label'] == '') {
if ($section->getLayoutSettings()['label'] != 'Title and Metadata') {
$section->setThirdPartySetting(
'layout_builder_lock',
'lock',
Expand All @@ -179,20 +179,22 @@ public function updateExistingEventsLock() {
$section_storage = $stored_data->data['section_storage'];
$sections = $section_storage->getSections();
foreach ($sections as $key => $section) {
if ($section->getLayoutSettings()['label'] == '') {
if ($section->getLayoutSettings()['label'] != 'Title and Metadata') {
$sectionToUpdate = $key;
}
}
$section_storage
->getSection($sectionToUpdate)
->setThirdPartySetting(
'layout_builder_lock',
'lock',
[
6 => 6,
7 => 7,
]
);
if (isset($sectionToUpdate)) {
$section_storage
->getSection($sectionToUpdate)
->setThirdPartySetting(
'layout_builder_lock',
'lock',
[
6 => 6,
7 => 7,
]
);
}
}
});

Expand Down

0 comments on commit c39bf80

Please sign in to comment.