Use ArticleListPage as the Core's default controller
authorAlexander Ebert <ebert@woltlab.com>
Sun, 25 Dec 2016 14:59:11 +0000 (15:59 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 25 Dec 2016 14:59:17 +0000 (15:59 +0100)
The landing page may never be null, doing so will break a lot of stuff
and we cannot recover from it.

wcfsetup/install/files/lib/system/cache/builder/PageCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php

index 595bb98bee5fb2cb8c0a39b7729a2210d94ab9b6..3bb9e9d567c438389379b7537802fd4b2bc53072 100644 (file)
@@ -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;
                        }
                }
index 76cc53abd470430543cc0a57875503034613df6c..b2e4b93eea39ec115278fa4a28c6578963d7199b 100644 (file)
@@ -1,7 +1,6 @@
 <?php
 namespace wcf\system\cache\builder;
 use wcf\data\application\Application;
-use wcf\data\page\Page;
 use wcf\data\page\PageCache;
 use wcf\page\CmsPage;
 use wcf\system\application\ApplicationHandler;
@@ -239,19 +238,12 @@ class RoutingCacheBuilder extends AbstractCacheBuilder {
                        if ($application->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 {