Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
menu_link_sync
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
menu_link_sync
Commits
0bd2e22d
Commit
0bd2e22d
authored
4 months ago
by
Yves Guide
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3475268
: Finding most popular menu should ignore current node
Ignore current menu item based on MenuPluginId
parent
694ccbf1
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_link_sync.module
+6
-0
6 additions, 0 deletions
menu_link_sync.module
with
6 additions
and
0 deletions
menu_link_sync.module
+
6
−
0
View file @
0bd2e22d
...
...
@@ -267,6 +267,12 @@ function _menu_link_sync_get_most_popular_menu_among_siblings($translation_sourc
$tree
=
_menu_link_sync_get_tree
(
$translation_source_link
->
menu_name
,
''
);
$popularity
=
array
();
foreach
(
$tree
as
$item
)
{
// Ignore current source menu items from loop.
// Because drupal will load the Node from cache and $target_language translation
// will contain source translation values.
if
(
$item
->
link
->
getPluginId
()
==
$translation_source_link
->
getMenuPluginId
(
$translation_source_link
->
getLangcode
())){
continue
;
}
// Find out if item has a version in the target language.
$target_link
=
_menu_link_sync_get_link_for_target_language
(
$item
->
link
->
getPluginId
(),
$target_language
);
if
(
empty
(
$target_link
))
{
...
...
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