aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/Route/CachingRouter.php1
-rw-r--r--lib/private/Route/Router.php1
2 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/Route/CachingRouter.php b/lib/private/Route/CachingRouter.php
index d88811f729e..314d4c22812 100644
--- a/lib/private/Route/CachingRouter.php
+++ b/lib/private/Route/CachingRouter.php
@@ -117,7 +117,6 @@ class CachingRouter extends Router {
* Closures cannot be serialized to cache, so for legacy routes calling an action we have to include the routes.php file again
*/
$app = $parameters['app'];
- $this->useCollection($app);
parent::requireRouteFile($parameters['route-file'], $app);
$collection = $this->getCollection($app);
$parameters['action'] = $collection->get($parameters['_route'])?->getDefault('action');
diff --git a/lib/private/Route/Router.php b/lib/private/Route/Router.php
index c26346bf998..1f6cb438cb2 100644
--- a/lib/private/Route/Router.php
+++ b/lib/private/Route/Router.php
@@ -482,6 +482,7 @@ class Router implements IRouter {
*/
protected function requireRouteFile(string $file, string $appName): void {
try {
+ $this->useCollection($appName);
$this->setupRoutes(include $file, $appName);
} catch (\TypeError) {
$this->logger->debug('Routes should only be registered by returning an array of routes from the routes.php');