From c983e2aa9232d2f3ad88628962837a3c7b7de8b6 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 30 Dec 2012 16:37:01 +0100 Subject: [PATCH] Fixes crucial ACPMenu-related bugs --- com.woltlab.wcf/acpMenu.xml | 2 +- .../lib/system/cache/builder/ACPMenuCacheBuilder.class.php | 3 +-- .../plugin/ACPMenuPackageInstallationPlugin.class.php | 7 +------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/com.woltlab.wcf/acpMenu.xml b/com.woltlab.wcf/acpMenu.xml index 3dd0b16712..e46669698c 100644 --- a/com.woltlab.wcf/acpMenu.xml +++ b/com.woltlab.wcf/acpMenu.xml @@ -25,7 +25,7 @@ wcf.acp.menu.link.option.management 1 - + diff --git a/wcfsetup/install/files/lib/system/cache/builder/ACPMenuCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/ACPMenuCacheBuilder.class.php index 740433f4f6..993e130935 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/ACPMenuCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/ACPMenuCacheBuilder.class.php @@ -42,8 +42,7 @@ class ACPMenuCacheBuilder implements ICacheBuilder { $conditions->add("menuItemID IN (?)", array($itemIDs)); // get needed menu items and build item tree - $sql = "SELECT menu_item.packageID, menuItem, parentMenuItem, - menuItemLink, permissions, options, packageDir + $sql = "SELECT * FROM wcf".WCF_N."_acp_menu_item menu_item LEFT JOIN wcf".WCF_N."_package package ON (package.packageID = menu_item.packageID) diff --git a/wcfsetup/install/files/lib/system/package/plugin/ACPMenuPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/ACPMenuPackageInstallationPlugin.class.php index 69e7e237eb..e7ad8ad037 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/ACPMenuPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/ACPMenuPackageInstallationPlugin.class.php @@ -26,18 +26,13 @@ class ACPMenuPackageInstallationPlugin extends AbstractMenuPackageInstallationPl $result = parent::prepareImport($data); // controller - $result['menuItemController'] = (isset($data['elements']['controller'])) ? $data['elements']['controller'] : ''; + $result['menuItemController'] = isset($data['elements']['controller']) ? $data['elements']['controller'] : ''; if (!empty($result['menuItemController'])) { if (!ClassUtil::isInstanceOf($result['menuItemController'], 'wcf\action\IAction') && !ClassUtil::isInstanceOf($result['menuItemController'], 'wcf\page\IPage')) { throw new SystemException("Menu item controller '".$result['menuItemController']."' is not a valid page controller"); } } - // validate controller and link (cannot be empty at the same time) - if (empty($result['menuItemLink']) && empty($result['menuItemController'])) { - throw new SystemException("Menu item '".$result['menuItem']."' neither has a link nor a controller given"); - } - return $result; } } -- 2.20.1