Skip to content

Commit 8708c34

Browse files
committed
initialize framework earlier
1 parent 58403bc commit 8708c34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Controller/FilesController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ public function fileAction(Request $request, string $file): BinaryFileResponse
5454
throw new PageNotFoundException();
5555
}
5656

57+
// Initialize the Contao framework
58+
$this->framework->initialize(true);
59+
5760
// Set the root page for the domain as the pageModel attribute
5861
$root = PageModel::findFirstPublishedRootByHostAndLanguage($request->getHost(), $request->getLocale());
5962

@@ -66,9 +69,6 @@ public function fileAction(Request $request, string $file): BinaryFileResponse
6669
throw new PageNotFoundException();
6770
}
6871

69-
// Initialize the Contao framework
70-
$this->framework->initialize(true);
71-
7272
// Get FilesModel entity
7373
$filesModel = FilesModel::findOneByPath($file);
7474

0 commit comments

Comments
 (0)