Fixed an ACP issue
authorAlexander Ebert <ebert@woltlab.com>
Wed, 27 Apr 2016 08:51:36 +0000 (10:51 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 27 Apr 2016 08:51:36 +0000 (10:51 +0200)
wcfsetup/install/files/lib/data/menu/item/MenuItemNodeTree.class.php
wcfsetup/install/files/lib/system/page/PageLocationManager.class.php

index 4afdeba3824163009b184587b93b41d8260dd46c..8a3209a5b59dd61056021bbd5fc538c6a6a2756e 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace wcf\data\menu\item;
 use wcf\system\page\PageLocationManager;
+use wcf\system\request\RequestHandler;
 
 /**
  * Represents a menu item node tree.
@@ -63,16 +64,19 @@ class MenuItemNodeTree {
                
                // find possible active menu items
                $activeMenuItems = [];
-               $possibleLocations = PageLocationManager::getInstance()->getLocations();
-               $length = count($possibleLocations);
-               foreach ($menuItemList as $menuItem) {
-                       for ($i = 0; $i < $length; $i++) {
-                               if ($menuItem->pageID == $possibleLocations[$i]['pageID'] && $menuItem->pageObjectID == $possibleLocations[$i]['pageObjectID']) {
-                                       if (!isset($activeMenuItems[$i])) {
-                                               $activeMenuItems[$i] = [];
+               
+               if (!RequestHandler::getInstance()->isACPRequest()) {
+                       $possibleLocations = PageLocationManager::getInstance()->getLocations();
+                       $length = count($possibleLocations);
+                       foreach ($menuItemList as $menuItem) {
+                               for ($i = 0; $i < $length; $i++) {
+                                       if ($menuItem->pageID == $possibleLocations[$i]['pageID'] && $menuItem->pageObjectID == $possibleLocations[$i]['pageObjectID']) {
+                                               if (!isset($activeMenuItems[$i])) {
+                                                       $activeMenuItems[$i] = [];
+                                               }
+                                               
+                                               $activeMenuItems[$i][] = $menuItem->itemID;
                                        }
-                                       
-                                       $activeMenuItems[$i][] = $menuItem->itemID;
                                }
                        }
                }
index 845a2c5b0739f5b7f5076ace362c18a01fbd189b..c2f27e6182d9ce4b17f3583095058335de0f51e1 100644 (file)
@@ -36,7 +36,6 @@ class PageLocationManager extends SingletonFactory {
                }
                
                $metaData = $activeRequest->getMetaData();
-               $link = $title = '';
                $page = null;
                if (isset($metaData['cms'])) {
                        $pageID = $metaData['cms']['pageID'];