Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
menu_item_extras-3228072
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
menu_item_extras-3228072
Commits
db5252c4
Commit
db5252c4
authored
3 years ago
by
Mykhailo Hurei
Committed by
Mykhailo Hurei
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Resolves
#3092021
by Petr Illek, ozin, mbopp: double suggestions
parent
9634452a
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
menu_item_extras.module
+3
-5
3 additions, 5 deletions
menu_item_extras.module
with
3 additions
and
5 deletions
menu_item_extras.module
+
3
−
5
View file @
db5252c4
...
...
@@ -216,12 +216,10 @@ function menu_item_extras_theme_suggestions_menu_alter(array &$suggestions, arra
/** @var \Drupal\menu_item_extras\Utility\Utility $utility */
$utility
=
\Drupal
::
service
(
'menu_item_extras.utility'
);
$menu_name
=
$utility
::
sanitizeMachineName
(
$menu_name
);
// We have to add back the original suggestion that normally is generated
// from the #theme, because in pre-process we are replacing it with 'menu'.
$suggestions
[]
=
$utility
::
suggestion
(
'menu'
,
$menu_name
);
if
(
Utility
::
checkBundleHasExtraFieldsThanEntity
(
'menu_link_content'
,
$variables
[
'menu_name'
]))
{
// We have to add back the original suggestion that normally is generated
// from the #theme, because in pre-process we are replacing it with 'menu'.
$suggestions
[]
=
$utility
::
suggestion
(
'menu'
,
$menu_name
);
$suggestion_prefix
=
'menu__extras'
;
// Custom suggestions.
$suggestions
[]
=
$suggestion_prefix
;
...
...
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