From 64a1be56f2ef06f8b4b2bea0cccc7c8b8374588a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 1 Jun 2022 14:20:28 +0200 Subject: [PATCH] Remove the Page::$isLandingPage property This property is redundant with wcf1_application.landingPageID for the 'wcf' app. Previously it needed to be kept in sync across both tables which didn't really work well in all cases. Remove this property to gain a single source of truth for the landing page. --- wcfsetup/install/files/acp/post_install.php | 14 ++++--- .../install/files/acp/templates/pageAdd.tpl | 38 ------------------- .../install/files/acp/templates/pageList.tpl | 2 +- .../form/ApplicationManagementForm.class.php | 13 ------- .../files/lib/acp/form/PageAddForm.class.php | 18 +-------- .../files/lib/acp/form/PageEditForm.class.php | 12 ------ .../files/lib/data/page/Page.class.php | 27 ++----------- .../cache/builder/PageCacheBuilder.class.php | 9 ++++- wcfsetup/install/lang/de.xml | 1 - wcfsetup/install/lang/en.xml | 1 - wcfsetup/setup/db/install.sql | 1 - 11 files changed, 22 insertions(+), 114 deletions(-) diff --git a/wcfsetup/install/files/acp/post_install.php b/wcfsetup/install/files/acp/post_install.php index 7896efb8fe..886f4ab405 100644 --- a/wcfsetup/install/files/acp/post_install.php +++ b/wcfsetup/install/files/acp/post_install.php @@ -8,13 +8,17 @@ use wcf\data\user\UserProfileAction; use wcf\system\WCF; // set default landing page -$sql = "UPDATE wcf" . WCF_N . "_page - SET isLandingPage = ? - WHERE identifier = ?"; -$statement = WCF::getDB()->prepareStatement($sql); +$sql = "UPDATE wcf1_application + SET landingPageID = ( + SELECT pageID + FROM wcf1_page + WHERE identifier = ? + ) + WHERE packageID = ?"; +$statement = WCF::getDB()->prepare($sql); $statement->execute([ - 1, 'com.woltlab.wcf.Dashboard', + 1, ]); // update administrator user rank and user online marking diff --git a/wcfsetup/install/files/acp/templates/pageAdd.tpl b/wcfsetup/install/files/acp/templates/pageAdd.tpl index 16c87aed37..9fefd9594c 100644 --- a/wcfsetup/install/files/acp/templates/pageAdd.tpl +++ b/wcfsetup/install/files/acp/templates/pageAdd.tpl @@ -1,34 +1,5 @@ {include file='header' pageTitle='wcf.acp.page.'|concat:$action} - - {if $action == 'add'}