Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
layout_builder_expand_collapse
Manage
Activity
Members
Labels
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WCMS
layout_builder_expand_collapse
Commits
30b91818
Commit
30b91818
authored
3 years ago
by
Tyler Struyk
Browse files
Options
Downloads
Patches
Plain Diff
Igor found errors in code.
parent
5d14f856
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/EventSubscriber/LayoutBuilderExpandCollapseEventSubscriber.php
+4
-2
4 additions, 2 deletions
...Subscriber/LayoutBuilderExpandCollapseEventSubscriber.php
with
4 additions
and
2 deletions
src/EventSubscriber/LayoutBuilderExpandCollapseEventSubscriber.php
+
4
−
2
View file @
30b91818
...
...
@@ -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'
][
'sett
t
ing'
]
==
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'
];
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment