From: Alexander Ebert Date: Sat, 21 May 2016 11:39:03 +0000 (+0200) Subject: Fixed `WCF::getActivePage()` failing for CMS pages X-Git-Tag: 3.0.0_Beta_1~1694 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5346b1830ed0bab863ec4a3a95f9345e4ac93825;p=GitHub%2FWoltLab%2FWCF.git Fixed `WCF::getActivePage()` failing for CMS pages --- diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index d0bc4c7b95..c349b58029 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -7,6 +7,7 @@ use wcf\data\package\PackageCache; use wcf\data\package\PackageEditor; use wcf\data\page\Page; use wcf\data\page\PageCache; +use wcf\page\CmsPage; use wcf\system\application\ApplicationHandler; use wcf\system\application\IApplication; use wcf\system\box\BoxHandler; @@ -805,6 +806,11 @@ class WCF { * @return Page|null */ public static function getActivePage() { + if (self::getActiveRequest()->getClassName() === CmsPage::class) { + $metaData = self::getActiveRequest()->getMetaData(); + return PageCache::getInstance()->getPage($metaData['cms']['pageID']); + } + return PageCache::getInstance()->getPageByController(self::getActiveRequest()->getClassName()); }