Project

General

Profile

Actions

Bug #105593

closed

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

Added by Alex Kellner 8 days ago. Updated 7 days ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2024-11-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
13
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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)

Actions #1

Updated by Garvin Hicking 8 days ago

  • Category set to Fluid
Actions #2

Updated by Garvin Hicking 8 days ago

  • Status changed from New to Needs Feedback

Thanks for the report.
To make debugging easier, are you maybe able to provide a minimal extension showcasing this in a repository or ZIP? And do you know if this ever worked, in v11 for example?

(I didn't investigate this properly, but pinged Simon and we'd like to have a look but are a bit short on time. But next week it's code sprint so something like this could be a good topic)

Actions #3

Updated by Alex Kellner 7 days ago · Edited

Thx for your time. Ticket can be closed (seems that I'm getting too old for TYPO3).
Overwriting works as expected in TYPO3 11, 12 and 13 here.


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

# Correct path (without Controller name as folder)
plugin.tx_lux_test.view.templateRootPaths.10 = EXT:luxenterprise/Resources/Private/Templates/
Actions #4

Updated by Garvin Hicking 7 days ago

  • Status changed from Needs Feedback to Closed

Thank you for adding this and solving this. I didn't spot that, too, in first place if that helps you feeling less old. Then again, I'm old too.... :-P

Actions

Also available in: Atom PDF