Issue Bug New Orphaned

#72600Singleton ConfigurationManager creates problems with nested extbase plugins

Robert Vock 01/08/16, 14:45 updated 12/18/18, 16:08

Description

This bug is a bit complicated to describe.

Currently the extbase ConfigurationManager is a singleton which has a state, for example AbstractConfigurationManager::$extensionName

When one extbase plugin calls cObjGetSingle on typoscript which also contains an extbase plugin, the configuration manager will hold incorrect values for the first plugin after the call.

This happens for example in the powermail extension, which allows fields to render a TypoScript object path. After rendering the typoscript, all calls to configurationManager->getConfiguration will return the configuration of the other plugin.

Another shortened example:

# TypoScript
page = PAGE
page.10  = USER
page.10 {
    userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
    extensionName = Plugin1
    pluginName = plugin1
    vendorName = Plugin1
}

lib.plugin2  = USER
lib.plugin2 {
    userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
    extensionName = Plugin2
    pluginName = plugin2
    vendorName = Plugin2
}

# Plugin1Controller.php
class Plugin1Controller extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
    public function plugin1Action() {
        $correct = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
        $string = $this->configurationManager->getContentObject()->cObjGetSingle('USER', $GLOBALS['TSFE']->tmpl->setup['lib.']['plugin2.']);
        $incorrect = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
    }
}

Plugin1 renders TypoScript which contains Plugin2. Afterwards Plugin1 cannot get it’s own configuration.

Reviews 0

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

Fix this issue

Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch

Commit message
[BUGFIX] Singleton ConfigurationManager creates problems with nested extbase plugins Resolves: #72600 Releases: main