From 21d5f3d8e4da7c9fb4c3057de28d0780740938fa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 1 Jun 2022 16:30:28 +0200 Subject: [PATCH] Skip page content without custom URL in RoutingCacheBuilder::getCustomUrls() This select was missing this condition ever since it was added in commit c2de61fb187cf357cd9653693a8fa7cad39ca6ef. It is not entirely clear, why this condition is missing, but everything indicates that this is a bug: The customURL for the page content can only ever be missing for pages backed by an actual controller (i.e. non-CMS pages). All those pages having the same empty controller will lead to conflicts in the resulting mapping table, with some undefined entry "winning" and ending up in the table. This specifically nullifies the effort of clearing the custom URL for non-i18n CMS pages that are landing pages. However by chance this all ends up working as intended, because the look up of the custom URL for those CMS pages will then result in an empty string for the controller, which is then completely ignored by the route building, skipping the logic in ControllerMap::isDefaultController() which relies on the empty controller pointing to the landing page instead of some random page. Clean this up by properly ignoring page content without a custom URL. --- .../lib/system/cache/builder/RoutingCacheBuilder.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 e05ca45378..5d8813c9d2 100644 --- a/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php +++ b/wcfsetup/install/files/lib/system/cache/builder/RoutingCacheBuilder.class.php @@ -258,7 +258,8 @@ class RoutingCacheBuilder extends AbstractCacheBuilder page.applicationPackageID FROM wcf1_page_content page_content INNER JOIN wcf1_page page - ON page.pageID = page_content.pageID"; + ON page.pageID = page_content.pageID + WHERE page_content.customURL <> ''"; $statement = WCF::getDB()->prepare($sql); $statement->execute(); while ($row = $statement->fetchArray()) { -- 2.20.1