Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
f2ecddea
Commit
f2ecddea
authored
Nov 11, 2008
by
webchick
Browse files
#328110
by Damien Tournoud: Remove recoverable fatal error from menu system.
parent
bd108c7f
Changes
2
Hide whitespace changes
Inline
Side-by-side
includes/menu.inc
View file @
f2ecddea
...
...
@@ -1913,6 +1913,7 @@ function menu_link_save(&$item) {
$existing_item
=
FALSE
;
if
(
isset
(
$item
[
'mlid'
]))
{
$existing_item
=
db_fetch_array
(
db_query
(
"SELECT * FROM
{
menu_links
}
WHERE mlid = %d"
,
$item
[
'mlid'
]));
$existing_item
[
'options'
]
=
unserialize
(
$existing_item
[
'options'
]);
}
if
(
isset
(
$item
[
'plid'
]))
{
...
...
@@ -2017,7 +2018,6 @@ 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
...
...
@@ -2033,7 +2033,7 @@ function menu_link_save(&$item) {
$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'
]);
$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
);
...
...
modules/menu/menu.module
View file @
f2ecddea
...
...
@@ -154,11 +154,13 @@ function menu_theme() {
*/
function
menu_enable
()
{
menu_rebuild
();
$link
=
db_fetch_array
(
db_query
(
"SELECT mlid AS plid, menu_name from
{
menu_links
}
WHERE link_path = 'admin/build/menu' AND module = 'system'"
));
$link
[
'router_path'
]
=
'admin/build/menu-customize/%'
;
$link
[
'module'
]
=
'menu'
;
$
base_
link
=
db_fetch_array
(
db_query
(
"SELECT mlid AS plid, menu_name from
{
menu_links
}
WHERE link_path = 'admin/build/menu' AND module = 'system'"
));
$
base_
link
[
'router_path'
]
=
'admin/build/menu-customize/%'
;
$
base_
link
[
'module'
]
=
'menu'
;
$result
=
db_query
(
"SELECT * FROM
{
menu_custom
}
"
);
while
(
$menu
=
db_fetch_array
(
$result
))
{
// $link is passed by reference to menu_link_save(), so we make a copy of $base_link.
$link
=
$base_link
;
$link
[
'mlid'
]
=
0
;
$link
[
'link_title'
]
=
$menu
[
'title'
];
$link
[
'link_path'
]
=
'admin/build/menu-customize/'
.
$menu
[
'menu_name'
];
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment