From 3f1cac0c92b0b924d9591bc78d295b79aed5bbbd Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 23 Feb 2013 17:06:33 +0100 Subject: [PATCH] Preventing first page menu item being disabled Fixes #1156 --- .../lib/data/page/menu/item/PageMenuItemEditor.class.php | 4 +++- .../lib/system/cache/builder/PageMenuCacheBuilder.class.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemEditor.class.php b/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemEditor.class.php index 3dbfc01ae9..ffbed894d6 100644 --- a/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemEditor.class.php +++ b/wcfsetup/install/files/lib/data/page/menu/item/PageMenuItemEditor.class.php @@ -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', '', '' diff --git a/wcfsetup/install/files/lib/system/cache/builder/PageMenuCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/PageMenuCacheBuilder.class.php index 29503a1b05..0d72a953bc 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/PageMenuCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/PageMenuCacheBuilder.class.php @@ -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(); -- 2.20.1