ConfigurationManager returns wrong configuration
My (simplified) page tree looks something like this:
 ├─ Root Page Site A │ ├─ Page 1 │ └─ Root Page Site B │ └─ Root Page Site C └─ MyExt Plugin
This is the configuration for these pages:
 Root TS template, site configuration
 Root TS template (clear setup + constants NOT set), site configuration
 Root TS template (includes static template for MyExt), site configuration
 Plugin flexform has an itemsProcFunc which requires a TS setting
In the itemsProcFunc I try to read the TS for MyExt like this:
$objectManager = GeneralUtility::makeInstance(ObjectManager::class); $configurationManager = $objectManager->get(ConfigurationManager::class); $tsConf = $configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
But this didn't give me the TS for MyExt. However, when I added the static template to , I did get the TS for MyExt.
I then debugged $configurationManager and noticed the following, when opening the plugin flexform:
concreteConfigurationManager => TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager currentPageId => 3 (integer)
The currentPageId doesn't make any sense. But at least it explains, why I'd get the TS for MyExt after adding the static template to page uid ...
The Extbase controller of the plugin on  gets the correct TS settings. In the TS object browser I get the correct TS configuration when standing on . It's only in the itemsProcFunc, where things seem to go wrong.
I have used this kind of function many times before (T3 < V9) without any problems, but never with site configurations.