Bug #106511
openRe-positioning module from different extension messes up Fluid paths
0%
Description
We have the following scenario: extension A has a BE module (positioned in module Web); extension B has a dependency on A and a BE module in a custom main module X (together with a group of other related extensions). Both modules are based on Extbase controllers.
If extension B is installed, extension A's module is supposed to be positioned next to extension B inside the custom module X, because they're functionally related (if you work with module B, you will constantly use module A as well) and it makes a lot of sense from a usability point of view.
Since extension A works independently from B and can be installed + used on its own, extension A's Modules.php is not the right place to position the module in X, because X might not even be there. So logically, this needs to be done in extension B, which knows for sure that extension A is installed, since it has a dependency on it.
I'm not sure, whether this (moving a module of another extension to a new position) is considered something you're allowed/supposed to do from TYPO3's point of view. But I think there are valid use cases for this in the real world. (This whole issue is based on feedback from a client, who requested this.)
I tried to achieve this by simply adding the definitions of module A to Modules.php of B, but obviously with different position settings. And it works! Module A is located at the new position within X. But if you then call module A, the problems start:
#1257246929 TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException
Tried resolving a template file for controller action "Default->Backend/List" in format ".html",
but none of the paths contained the expected template file (Default/Backend/List.html).
The following paths were checked: /www/mysite/vendor/typo3/cms-backend/Resources/Private/Templates/,
/www/mysite/vendor/myvendor/extension-b/Resources/Private/Templates/,
/www/mysite/vendor/myvendor/extension-b/Resources/Private/Backend/Templates/
This doesn't seem to make any sense. Nothing has changed in extension A. Extension B has made the exact same definition for A's module except for the position.
Why would this have any effect on the inner workings of extension A's BackendController? The configuration in Modules.php specifies a fully namespaced controller and the name of the extension. Why are templates within extension A now searched in the paths for extension B? I'm not sure, if this is intended behaviour. It feels buggy.
Or is it possible to do this in a different/better/cleaner way?
No data to display