Fixes crucial ACPMenu-related bugs
authorMatthias Schmidt <gravatronics@live.com>
Sun, 30 Dec 2012 15:37:01 +0000 (16:37 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 30 Dec 2012 15:37:01 +0000 (16:37 +0100)
com.woltlab.wcf/acpMenu.xml
wcfsetup/install/files/lib/system/cache/builder/ACPMenuCacheBuilder.class.php
wcfsetup/install/files/lib/system/package/plugin/ACPMenuPackageInstallationPlugin.class.php

index 3dd0b167121744fbaada60a03b51ae55eac64cbe..e46669698cd226026e9ace0c72ea3287d5a1279f 100644 (file)
@@ -25,7 +25,7 @@
                <acpmenuitem name="wcf.acp.menu.link.option.importAndExport">
                        <parent>wcf.acp.menu.link.option.management</parent>
                        <showorder>1</showorder>
-                       <controller><![CDATA[OptionImport]]></controller>
+                       <controller><![CDATA[wcf\acp\form\OptionImportForm]]></controller>
                </acpmenuitem>
                <!-- /options -->
                
index 740433f4f6ca62515bceef39d3867ee58c385042..993e130935604b78d8cb9ba9b6979990a86ffafa 100644 (file)
@@ -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)
index 69e7e237eb7abcc387103d9086d2edd9b6ed7373..e7ad8ad03739d8582aa8ce434cee489e53034f85 100644 (file)
@@ -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;
        }
 }