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
ee2afa19
Commit
ee2afa19
authored
May 28, 2007
by
Dries
Browse files
- Patch
#145058
by pwolanin: update parents when a child is deleted.
parent
7131fd53
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/menu.inc
View file @
ee2afa19
...
@@ -1261,6 +1261,11 @@ function _menu_delete_item($item) {
...
@@ -1261,6 +1261,11 @@ function _menu_delete_item($item) {
}
}
}
}
db_query
(
'DELETE FROM {menu_links} WHERE mlid = %d'
,
$item
[
'mlid'
]);
db_query
(
'DELETE FROM {menu_links} WHERE mlid = %d'
,
$item
[
'mlid'
]);
// Update the has_children status of the parent
$children
=
(
bool
)
db_result
(
db_query
(
"SELECT COUNT(*) FROM
{
menu_links
}
WHERE plid = %d AND hidden = 0"
,
$item
[
'plid'
]));
db_query
(
"UPDATE
{
menu_links
}
SET has_children = %d WHERE mlid = %d"
,
$children
,
$item
[
'plid'
]);
menu_cache_clear
(
$item
[
'menu_name'
]);
menu_cache_clear
(
$item
[
'menu_name'
]);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
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