- Patch #88707 by kkaefer: make menu_set_active_item recompute the contextual menu items. Bugfix.

5.x
Dries Buytaert 2006-10-23 17:57:31 +00:00
parent 6b2dd3f75e
commit eae420960f
1 changed files with 5 additions and 1 deletions

View File

@ -432,13 +432,17 @@ function menu_set_active_item($path = NULL) {
static $stored_mid;
if (!isset($stored_mid) || isset($path)) {
$menu = menu_get_menu();
if (!isset($path)) {
$path = $_GET['q'];
}
else {
$_GET['q'] = $path;
// If we change ?q= we need to rebuild the contextual menu items
// because they are often variable depending on the value of ?q=.
_menu_append_contextual_items();
}
$menu = menu_get_menu();
while ($path && !isset($menu['path index'][$path])) {
$path = substr($path, 0, strrpos($path, '/'));