Preventing first page menu item being disabled
authorAlexander Ebert <ebert@woltlab.com>
Sat, 23 Feb 2013 16:06:33 +0000 (17:06 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 23 Feb 2013 16:06:33 +0000 (17:06 +0100)
Fixes #1156

wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemEditor.class.php
wcfsetup/install/files/lib/system/cache/builder/PageMenuCacheBuilder.class.php

index 3dbfc01ae910573f69258f02ad4378c2d59c5ca2..ffbed894d64f819f09c28ee058476030653dc643 100644 (file)
@@ -71,7 +71,8 @@ class PageMenuItemEditor extends DatabaseObjectEditor implements IEditableCached
                $statement->execute();
                
                $sql = "UPDATE          wcf".WCF_N."_page_menu_item
-                       SET             isLandingPage = ?
+                       SET             isLandingPage = ?,
+                                       isDisabled = ?
                        WHERE           menuPosition = ?
                                        AND parentMenuItem = ?
                                        AND menuItemController <> ?
@@ -79,6 +80,7 @@ class PageMenuItemEditor extends DatabaseObjectEditor implements IEditableCached
                $statement = WCF::getDB()->prepareStatement($sql, 1);
                $statement->execute(array(
                        1,
+                       0,
                        'header',
                        '',
                        ''
index 29503a1b0506be774f82de28ea8f0417ee09010a..0d72a953bc8c1e3d2fe238bab26cd8e57fe0fa90 100644 (file)
@@ -20,7 +20,7 @@ class PageMenuCacheBuilder extends AbstractCacheBuilder {
                $data = array();
                
                $menuItemList = new PageMenuItemList();
-               $menuItemList->getConditionBuilder()->add("page_menu_item.isDisabled = ?", array(0));
+               $menuItemList->getConditionBuilder()->add("(page_menu_item.isDisabled = ? OR page_menu_item.isLandingPage = ?)", array(0, 1));
                $menuItemList->sqlOrderBy = "page_menu_item.showOrder ASC";
                $menuItemList->readObjects();