Issue Bug Closed

#102773Static route causes type error when using EXT: syntax

Lina Wolf 01/08/24, 08:38 updated 07/09/24, 15:12

Description

When I define a static route like this in TYPO3 v12.4.9, PHP 8.2:

routes:
  -
    route: robots.txt
    type: staticText
    source: 'EXT:my_sitepackage_mysite/Resources/Public/robots.txt'

I get a type error:

TYPO3\CMS\Core\Http\HtmlResponse::__construct(): Argument #1 ($content) must be of type string, null given, called in /var/www/html/vendor/typo3/cms-frontend/Classes/Middleware/StaticRouteResolver.php on line 60

I would expect the EXT syntax to work here. But even if the file is not found it should not cause a PHP type Error

Reviews 2