Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
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
drupal
Commits
07fe4198
Commit
07fe4198
authored
19 years ago
by
Gerhard Killesreiter
Browse files
Options
Downloads
Patches
Plain Diff
#42388
, Rehaul menu builder, patch by chx
parent
05c20c77
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
includes/menu.inc
+17
-20
17 additions, 20 deletions
includes/menu.inc
with
17 additions
and
20 deletions
includes/menu.inc
+
17
−
20
View file @
07fe4198
...
@@ -592,31 +592,28 @@ function menu_rebuild() {
...
@@ -592,31 +592,28 @@ function menu_rebuild() {
}
}
}
}
reset
(
$new_items
);
// Save the new items updating the pids in each iteration
while
(
list
(
$old_mid
,
$item
)
=
each
(
$new_items
))
{
while
(
count
(
$new_items
))
{
if
(
$item
[
'pid'
]
<
0
&&
isset
(
$new_items
[
$item
[
'pid'
]]))
{
foreach
(
$new_items
as
$mid
=>
$item
)
{
// The item's parent has a temporary ID and is still in the queue. Put
// If the item has a valid parent, save it
// the item at the back of the queue so it may be saved after the
if
(
$item
[
'pid'
]
>=
0
)
{
// parent item has recieved a new ID.
// The new menu ID gets passed back by reference as $item['mid']
$new_items
[
$old_mid
]
=
$item
;
menu_save_item
(
$item
);
}
// Fix parent IDs for the children of the menu item just saved
else
{
if
(
$item
[
'children'
])
{
// The new menu ID gets passed back by reference as $item['mid']
foreach
(
$item
[
'children'
]
as
$child
)
{
menu_save_item
(
$item
);
if
(
isset
(
$new_items
[
$child
]))
{
$new_items
[
$child
][
'pid'
]
=
$item
[
'mid'
];
// Fix parent IDs for menu items just added.
}
if
(
$item
[
'children'
])
{
foreach
(
$item
[
'children'
]
as
$child
)
{
if
(
isset
(
$new_items
[
$child
]))
{
$new_items
[
$child
][
'pid'
]
=
$item
[
'mid'
];
}
}
}
}
// remove the item
unset
(
$new_items
[
$mid
]);
}
}
}
}
// Rebuild the menu to account for the changes.
_menu_build
();
}
}
// Rebuild the menu to account for the changes.
_menu_build
();
}
}
// Reset the cached $menu in menu_get_item().
// Reset the cached $menu in menu_get_item().
...
...
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