Remove logic for the clearing of custom URLs for CMS pages from RoutingCacheBuilder
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 1 Jun 2022 14:40:56 +0000 (16:40 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 1 Jun 2022 14:56:59 +0000 (16:56 +0200)
This is workaround is no longer required or useful since the previous commit,
since `ControllerMap::isDefaultController()` will correctly return `true` for
those CMS pages, leading to the route builder dropping the controller part in
the URL.

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

index 5d8813c9d25d789583f7ba45adfa31c885d268cc..066ea348176e8f172c36129b2cb6e4f54b3b2ac6 100644 (file)
@@ -266,11 +266,6 @@ class RoutingCacheBuilder extends AbstractCacheBuilder
             $rows[] = $row;
         }
 
-        $cmsPageID = 0;
-        if (\preg_match('~^__WCF_CMS__(\d+)$~', $landingPages['wcf']['controller'], $matches)) {
-            $cmsPageID = $matches[1];
-        }
-
         foreach ($rows as $row) {
             $customUrl = FileUtil::removeLeadingSlash(FileUtil::removeTrailingSlash($row['controllerCustomURL']));
             $packageID = $row['applicationPackageID'];
@@ -286,23 +281,7 @@ class RoutingCacheBuilder extends AbstractCacheBuilder
                 $data['reverse'][$abbreviation][$this->classNameToControllerName($row['controller'])] = $customUrl;
             } else {
                 $cmsIdentifier = '__WCF_CMS__' . $row['pageID'] . '-' . ($row['languageID'] ?: 0);
-
-                // Discard the custom url if this CMS page is the landing page of its associated app.
-                if (
-                    !empty($landingPages[$abbreviation])
-                    && $landingPages[$abbreviation]['controller'] === '__WCF_CMS__' . $row['pageID']
-                    && !$row['languageID']
-                ) {
-                    $customUrl = '';
-                }
                 $data['reverse'][$abbreviation][$cmsIdentifier] = $customUrl;
-
-                if ($cmsPageID && $abbreviation === 'wcf') {
-                    if ($customUrl === '' && $cmsPageID != $row['pageID']) {
-                        continue;
-                    }
-                }
-
                 $data['lookup'][$abbreviation][$customUrl] = $cmsIdentifier;
             }
         }