Project

General

Profile

Actions

Bug #88572

open

ConfigurationManager returns wrong configuration

Added by Michael Stopp almost 5 years ago. Updated over 2 years ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2019-06-17
Due date:
% Done:

0%

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

Description

My (simplified) page tree looks something like this:

[0]
 ├─[1] Root Page Site A
 │  ├─[2] Page 1
 │  └─[3] Root Page Site B
 │
 └─[4] Root Page Site C
    └─[5] MyExt Plugin

This is the configuration for these pages:

[1] Root TS template, site configuration
[3] Root TS template (clear setup + constants NOT set), site configuration
[4] Root TS template (includes static template for MyExt), site configuration
[5] 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 [1], 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 [1]...
The Extbase controller of the plugin on [5] gets the correct TS settings. In the TS object browser I get the correct TS configuration when standing on [5]. 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.


Related issues 4 (2 open2 closed)

Related to TYPO3 Core - Feature #90429: ConfigurationManager should offer a way to define the site it is fetching a configuration forClosed2020-02-19

Actions
Related to TYPO3 Core - Task #54813: BackendConfigurationManager figures out wrong pidClosed2014-01-07

Actions
Related to TYPO3 Core - Bug #93251: getCurrentPageId not working correctly in multisite systemsNew2021-01-08

Actions
Related to TYPO3 Core - Bug #102380: Resolve correct page UID in BackendConfigurationManagerNew2023-11-16

Actions
Actions

Also available in: Atom PDF