Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3253715
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
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
drupal-3253715
Commits
9aaa5042
Commit
9aaa5042
authored
16 years ago
by
Gábor Hojtsy
Browse files
Options
Downloads
Patches
Plain Diff
Rolling back
#302638
, it caused problems reported in
#328110
parent
97d5a361
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
includes/menu.inc
+21
-35
21 additions, 35 deletions
includes/menu.inc
with
21 additions
and
35 deletions
includes/menu.inc
+
21
−
35
View file @
9aaa5042
...
...
@@ -1844,7 +1844,7 @@ function menu_link_save(&$item) {
// This is the easiest way to handle the unique internal path '<front>',
// since a path marked as external does not need to match a router path.
$item
[
'external'
]
=
menu_path_is_external
(
$item
[
'link_path'
])
||
$item
[
'link_path'
]
==
'<front>'
;
$item
[
'
_
external'
]
=
menu_path_is_external
(
$item
[
'link_path'
])
||
$item
[
'link_path'
]
==
'<front>'
;
// Load defaults.
$item
+=
array
(
'menu_name'
=>
'navigation'
,
...
...
@@ -1864,13 +1864,7 @@ function menu_link_save(&$item) {
}
if
(
isset
(
$item
[
'plid'
]))
{
if
(
$item
[
'plid'
])
{
$parent
=
db_fetch_array
(
db_query
(
"SELECT * FROM
{
menu_links
}
WHERE mlid = %d"
,
$item
[
'plid'
]));
}
else
{
// Don't bother with the query - mlid can never equal zero.
$parent
=
FALSE
;
}
$parent
=
db_fetch_array
(
db_query
(
"SELECT * FROM
{
menu_links
}
WHERE mlid = %d"
,
$item
[
'plid'
]));
}
else
{
// Find the parent - it must be unique.
...
...
@@ -1922,7 +1916,7 @@ function menu_link_save(&$item) {
%d, %d,
'%s', '%s', '%s', %d, %d)"
,
$item
[
'menu_name'
],
$item
[
'plid'
],
$item
[
'link_path'
],
$item
[
'hidden'
],
$item
[
'external'
],
$item
[
'has_children'
],
$item
[
'hidden'
],
$item
[
'
_
external'
],
$item
[
'has_children'
],
$item
[
'expanded'
],
$item
[
'weight'
],
$item
[
'module'
],
$item
[
'link_title'
],
serialize
(
$item
[
'options'
]),
$item
[
'customized'
],
$item
[
'updated'
]);
...
...
@@ -1957,7 +1951,7 @@ function menu_link_save(&$item) {
// Find the callback. During the menu update we store empty paths to be
// fixed later, so we skip this.
if
(
!
isset
(
$_SESSION
[
'system_update_6021'
])
&&
(
empty
(
$item
[
'router_path'
])
||
!
$existing_item
||
(
$existing_item
[
'link_path'
]
!=
$item
[
'link_path'
])))
{
if
(
$item
[
'external'
])
{
if
(
$item
[
'
_
external'
])
{
$item
[
'router_path'
]
=
''
;
}
else
{
...
...
@@ -1966,32 +1960,24 @@ function menu_link_save(&$item) {
$item
[
'router_path'
]
=
_menu_find_router_path
(
$menu
,
$item
[
'link_path'
]);
}
}
$item
[
'options'
]
=
serialize
(
$item
[
'options'
]);
// If every value in $existing_item is the same in the $item, there is no
// reason to run the update queries or clear the caches. We use
// array_diff_assoc() with the $existing_item as the first parameter
// because $item has additional keys left over from the process of building
// the router item.
if
(
!
$existing_item
||
array_diff_assoc
(
$existing_item
,
$item
))
{
db_query
(
"UPDATE
{
menu_links
}
SET menu_name = '%s', plid = %d, link_path = '%s',
router_path = '%s', hidden = %d, external = %d, has_children = %d,
expanded = %d, weight = %d, depth = %d,
p1 = %d, p2 = %d, p3 = %d, p4 = %d, p5 = %d, p6 = %d, p7 = %d, p8 = %d, p9 = %d,
module = '%s', link_title = '%s', options = '%s', customized = %d WHERE mlid = %d"
,
$item
[
'menu_name'
],
$item
[
'plid'
],
$item
[
'link_path'
],
$item
[
'router_path'
],
$item
[
'hidden'
],
$item
[
'external'
],
$item
[
'has_children'
],
$item
[
'expanded'
],
$item
[
'weight'
],
$item
[
'depth'
],
$item
[
'p1'
],
$item
[
'p2'
],
$item
[
'p3'
],
$item
[
'p4'
],
$item
[
'p5'
],
$item
[
'p6'
],
$item
[
'p7'
],
$item
[
'p8'
],
$item
[
'p9'
],
$item
[
'module'
],
$item
[
'link_title'
],
$item
[
'options'
],
$item
[
'customized'
],
$item
[
'mlid'
]);
// Check the has_children status of the parent.
_menu_update_parental_status
(
$item
);
menu_cache_clear
(
$menu_name
);
if
(
$existing_item
&&
$menu_name
!=
$existing_item
[
'menu_name'
])
{
menu_cache_clear
(
$existing_item
[
'menu_name'
]);
}
_menu_clear_page_cache
();
db_query
(
"UPDATE
{
menu_links
}
SET menu_name = '%s', plid = %d, link_path = '%s',
router_path = '%s', hidden = %d, external = %d, has_children = %d,
expanded = %d, weight = %d, depth = %d,
p1 = %d, p2 = %d, p3 = %d, p4 = %d, p5 = %d, p6 = %d, p7 = %d, p8 = %d, p9 = %d,
module = '%s', link_title = '%s', options = '%s', customized = %d WHERE mlid = %d"
,
$item
[
'menu_name'
],
$item
[
'plid'
],
$item
[
'link_path'
],
$item
[
'router_path'
],
$item
[
'hidden'
],
$item
[
'_external'
],
$item
[
'has_children'
],
$item
[
'expanded'
],
$item
[
'weight'
],
$item
[
'depth'
],
$item
[
'p1'
],
$item
[
'p2'
],
$item
[
'p3'
],
$item
[
'p4'
],
$item
[
'p5'
],
$item
[
'p6'
],
$item
[
'p7'
],
$item
[
'p8'
],
$item
[
'p9'
],
$item
[
'module'
],
$item
[
'link_title'
],
serialize
(
$item
[
'options'
]),
$item
[
'customized'
],
$item
[
'mlid'
]);
// Check the has_children status of the parent.
_menu_update_parental_status
(
$item
);
menu_cache_clear
(
$menu_name
);
if
(
$existing_item
&&
$menu_name
!=
$existing_item
[
'menu_name'
])
{
menu_cache_clear
(
$existing_item
[
'menu_name'
]);
}
_menu_clear_page_cache
();
return
$item
[
'mlid'
];
}
...
...
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