Fixed issues in menu item creation
authorMarcel Werk <burntime@woltlab.com>
Thu, 10 Mar 2016 23:55:10 +0000 (00:55 +0100)
committerMarcel Werk <burntime@woltlab.com>
Thu, 10 Mar 2016 23:55:10 +0000 (00:55 +0100)
wcfsetup/install/files/lib/acp/form/MenuItemAddForm.class.php
wcfsetup/install/files/lib/data/menu/item/MenuItemEditor.class.php

index 93196fcd25c736473a331aa6d2c8b6f2780d2014..3fd3800e217f1aa9eab71c8855d6e0d4af23d1ff 100644 (file)
@@ -185,7 +185,8 @@ class MenuItemAddForm extends AbstractForm {
                        'menuID' => $this->menuID,
                        'parentItemID' => $this->parentItemID,
                        'showOrder' => $this->showOrder,
-                       'identifier' => StringUtil::getRandomID()
+                       'identifier' => StringUtil::getRandomID(),
+                       'packageID' => 1
                ])]);
                $this->objectAction->executeAction();
                
index ae70bf43736c95e6885808276c8548cb4aaf0af1..6ab86c01779df2e26c03d0f05565e05620c4f4f1 100644 (file)
@@ -1,6 +1,8 @@
 <?php
 namespace wcf\data\menu\item;
 use wcf\data\DatabaseObjectEditor;
+use wcf\data\IEditableCachedObject;
+use wcf\system\cache\builder\MenuCacheBuilder;
 use wcf\system\language\LanguageFactory;
 use wcf\system\WCF;
 
@@ -15,7 +17,7 @@ use wcf\system\WCF;
  * @category   Community Framework
  * @since      2.2
  */
-class MenuItemEditor extends DatabaseObjectEditor {
+class MenuItemEditor extends DatabaseObjectEditor implements IEditableCachedObject {
        /**
         * @inheritDoc
         */
@@ -73,4 +75,11 @@ class MenuItemEditor extends DatabaseObjectEditor {
                
                return $menuItem;
        }
+       
+       /**
+        * @inheritDoc
+        */
+       public static function resetCache() {
+               MenuCacheBuilder::getInstance()->reset();
+       }
 }