summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-10-23 17:57:31 +0000
committerDries Buytaert <dries@buytaert.net>2006-10-23 17:57:31 +0000
commiteae420960fc0b35120d15fdcfd6376391b4a5de3 (patch)
tree6d56e88df803359d5ae62c602d5d8b178d4f8918
parent6b2dd3f75e3f9839b2433cb753da24e2adc863ff (diff)
downloadbrdo-eae420960fc0b35120d15fdcfd6376391b4a5de3.tar.gz
brdo-eae420960fc0b35120d15fdcfd6376391b4a5de3.tar.bz2
- Patch #88707 by kkaefer: make menu_set_active_item recompute the contextual menu items. Bugfix.
-rw-r--r--includes/menu.inc6
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/menu.inc b/includes/menu.inc
index 20fed8f90..65e0a4f5d 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
@@ -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, '/'));