Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
menu_link_attributes
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
menu_link_attributes
Merge requests
!26
Split update hooks
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Open
Split update hooks
issue/menu_link_attributes-3472203:3472203-fix-update-hook-description
into
8.x-1.x
Overview
0
Commits
1
Pipelines
1
Changes
1
Open
Split update hooks
Julian Pustkuchen
requested to merge
issue/menu_link_attributes-3472203:3472203-fix-update-hook-description
into
8.x-1.x
11 months ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Closes
#3472203
0
0
Merge request reports
Compare
8.x-1.x
8.x-1.x (HEAD)
and
latest version
latest version
02896cea
1 commit,
11 months ago
1 file
+
15
−
2
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
menu_link_attributes.install
+
15
−
2
View file @ 919a8ceb
Edit in single-file editor
Open in Web IDE
Show full file
@@ -81,7 +81,7 @@ function menu_link_attributes_update_8001(&$sandbox) {
}
/**
* Add
labels and description to default menu item attributes for clarification
.
* Add
"Container class(es)" attribute to default attributes
.
*/
function
menu_link_attributes_update_8002
():
void
{
$attributes
=
\Drupal
::
configFactory
()
@@ -96,7 +96,20 @@ function menu_link_attributes_update_8002(): void {
];
}
// Only set if still existing in custom config:
\Drupal
::
configFactory
()
->
getEditable
(
'menu_link_attributes.config'
)
->
set
(
'attributes'
,
$attributes
)
->
save
();
}
/**
* Add labels and description to default menu item attributes for clarification.
*/
function
menu_link_attributes_update_8003
():
void
{
$attributes
=
\Drupal
::
configFactory
()
->
get
(
'menu_link_attributes.config'
)
->
get
(
'attributes'
);
// Only set labels and description if still existing in custom config:
if
(
isset
(
$attributes
[
'class'
]))
{
// Only set if not yet set custom:
if
(
empty
(
$attributes
[
'class'
][
'label'
]))
{
Loading