Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uw_cfg_common
Manage
Activity
Members
Labels
Code
Merge requests
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
uw_cfg_common
Commits
d07ee981
Commit
d07ee981
authored
4 years ago
by
Eric Bremner
Browse files
Options
Downloads
Plain Diff
Merge branch '8.x-1.x' into feature/ISTWCMS-4208-ebremner-unpublishing
parents
18ae8fb0
0ae898e4
No related branches found
No related tags found
1 merge request
!19
Feature/istwcms 4208 ebremner unpublishing
Changes
41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
uw_cfg_common.module
+22
-1
22 additions, 1 deletion
uw_cfg_common.module
with
22 additions
and
1 deletion
uw_cfg_common.module
+
22
−
1
View file @
d07ee981
...
...
@@ -5,10 +5,31 @@
* Module file.
*/
use
Drupal\Core\Entity\EntityInterface
;
use
Drupal\Core\Form\FormStateInterface
;
use
Drupal\webform\WebformInterface
;
use
Drupal\webform\WebformSubmissionStorageInterface
;
/**
* Implements hook_entity_presave().
*/
function
uw_cfg_common_entity_presave
(
EntityInterface
$entity
)
{
// Check if we are on a menu link.
if
(
$entity
->
getEntityTypeId
()
==
'menu_link_content'
)
{
// Check that we are on a Information For (audience) link.
if
(
$entity
->
menu_name
->
value
==
'uw-menu-audience-menu'
)
{
// Invalid all the menu caching.
\Drupal
::
cache
(
'menu'
)
->
invalidateAll
();
// Rebuild all the menus.
\Drupal
::
service
(
'plugin.manager.menu.link'
)
->
rebuild
();
}
}
}
/**
* Implements hook_form_FORM_ID_alter().
*
...
...
@@ -19,7 +40,7 @@ function uw_cfg_common_form_layout_builder_configure_section_alter(array &$form,
unset
(
$form
[
'layout_builder_style'
][
'#empty_option'
]);
// Ensuring that the contained width is selected by default.
$form
[
'layout_builder_style'
][
'#default_value'
]
=
$form
[
'layout_builder_style'
][
'#default_value'
]
?:
'uw
-
contained
-
width'
;
$form
[
'layout_builder_style'
][
'#default_value'
]
=
$form
[
'layout_builder_style'
][
'#default_value'
]
?:
'uw
_lbs_
contained
_
width'
;
}
/**
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
Next
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