use wcf\data\ITitledLinkObject;
use wcf\data\page\PageCache;
+use wcf\system\event\EventHandler;
use wcf\system\exception\SystemException;
+use wcf\system\page\event\ResolveCurrentPage;
use wcf\system\request\RequestHandler;
use wcf\system\SingletonFactory;
use wcf\system\WCF;
$page = PageCache::getInstance()->getPage($pageID);
} else {
$page = PageCache::getInstance()->getPageByController($activeRequest->getClassName());
+
+ if ($page === null) {
+ $event = new ResolveCurrentPage($activeRequest);
+ EventHandler::getInstance()->fire($event);
+ $page = $event->page;
+ }
+
if ($page !== null) {
$pageID = $page->pageID;
--- /dev/null
+<?php
+
+namespace wcf\system\page\event;
+
+use wcf\data\page\Page;
+use wcf\system\event\IEvent;
+use wcf\system\request\Request;
+
+/**
+ * Indicates that the `PageLocationManager` could not determine the active page.
+ *
+ * @author Marcel Werk
+ * @copyright 2001-2023 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @since 6.0
+ */
+final class ResolveCurrentPage implements IEvent
+{
+ public Page|null $page = null;
+
+ public function __construct(public readonly Request $request)
+ {
+ }
+}