Skip to content
Snippets Groups Projects
Commit 30b91818 authored by Tyler Struyk's avatar Tyler Struyk
Browse files

Igor found errors in code.

parent 5d14f856
No related branches found
No related tags found
No related merge requests found
......@@ -154,17 +154,19 @@ class LayoutBuilderExpandCollapseEventSubscriber implements EventSubscriberInter
/** @var \Drupal\layout_builder\Form\ConfigureBlockFormBase $formObject */
$formObject = $formState->getFormObject();
// Get expand collapse settings from form.
$formExpandCollapseSettings = $formState->getValue('expand_collapse');
// Note: getLayout() gets Current Section, not current Layout.
$currentSectionConfig = $formObject->getLayout()->getConfiguration();
// Track if the expand/collapse was on, but now it is off.
if (isset($currentSectionConfig['expand_collapse']['setting']) &&
$currentSectionConfig['expand_collapse']['settting'] == 1 &&
$currentSectionConfig['expand_collapse']['setting'] == 1 &&
$formExpandCollapseSettings['setting'] == 0) {
$expandCollapseTurnedOff = TRUE;
}
$formExpandCollapseSettings = $formState->getValue('expand_collapse');
if ($formExpandCollapseSettings['group'] == 'other' && !empty($formExpandCollapseSettings['new_grouping'])) {
$formExpandCollapseSettings['group'] = $formExpandCollapseSettings['new_grouping'];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment