Issue Bug Closed

#105593Extbase action via userFunc Bootstrap->run: Overrule templateRootPaths seems not to work

Alex Kellner 11/13/24, 16:01 updated 11/14/24, 16:42

Description

I just stumbled over the issue that it seems not possible to add additional templateRootPaths via TypoScript when using TYPO3\CMS\Extbase\Core\Bootstrap->run for an action (in TYPO3 12 and 13).

How to reproduce

Extension A: ext_localconf.php

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
  'Lux',
  'Test',
  [\In2code\Lux\Controller\FrontendController::class => 'test']
);

Extension A: TypoScript setup

test = PAGE
test {
  typeNum = 123456

  10 = USER_INT
  10 {
    userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
    extensionName = Lux
    pluginName = Test
    vendorName = In2code
    controller = Frontend
  }
}

Extension A: Controller

<?php

declare(strict_types=1);
namespace In2code\Lux\Controller;

use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;

class FrontendController extends ActionController
{
    public function testAction(): ResponseInterface
    {
        return $this->htmlResponse();
    }
}

The HTML template from Path EXT:lux/Resources/Private/Templates/Frontend/Test.html is used for templateRootPaths.0 (even if it is not explicitly defined in TypoScript) – what’s correct.

But if an additional Extension sets another path with .10, the original path is still used:

plugin.tx_lux_test.view.templateRootPaths.10 = EXT:luxenterprise/Resources/Private/Templates/Frontend

—-

If I doublecheck the paths by simply removing the original template file, the additional file is used correctly. Even the used TypoScript seems to be correct in backend.

A debug of the ActionController seems to be okay for me:

0 => 'EXT:lux/Resources/Private/Templates/' (36 chars)
1 => 'EXT:luxenterprise/Resources/Private/Templates/Frontend' (54 chars)

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.