From: Alexander Ebert Date: Sun, 25 Dec 2016 14:59:11 +0000 (+0100) Subject: Use ArticleListPage as the Core's default controller X-Git-Tag: 3.0.0_RC_3~45 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=200600d1e56f99f721f8bf106cdce40cc7b2bc06;p=GitHub%2FWoltLab%2FWCF.git Use ArticleListPage as the Core's default controller The landing page may never be null, doing so will break a lot of stuff and we cannot recover from it. --- diff --git a/wcfsetup/install/files/lib/system/cache/builder/PageCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/PageCacheBuilder.class.php index 595bb98bee..3bb9e9d567 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/PageCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/PageCacheBuilder.class.php @@ -51,7 +51,7 @@ class PageCacheBuilder extends AbstractCacheBuilder { $data['identifier'][$page->identifier] = $page->pageID; $data['controller'][$page->controller] = $page->pageID; - if ($page->isLandingPage) { + if ($page->isLandingPage || ($data['landingPage'] === null && $page->identifier === 'com.woltlab.wcf.ArticleList')) { $data['landingPage'] = $page; } } diff --git a/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php b/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php index 76cc53abd4..b2e4b93eea 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php @@ -1,7 +1,6 @@ packageID == 1) { // handle WCF $page = PageCacheBuilder::getInstance()->getData([], 'landingPage'); - if ($page === null) { - // no landing page defined - $controller = ['', '', '']; + if ($page->controller) { + $controller = $page->controller; } else { - if ($page->controller) { - $controller = $page->controller; - } - else { - $controller = '__WCF_CMS__' . $page->pageID; - $controller = [$controller, $controller, CmsPage::class]; - } - + $controller = '__WCF_CMS__' . $page->pageID; + $controller = [$controller, $controller, CmsPage::class]; } } else {