Actions
Bug #72600
openSingleton ConfigurationManager creates problems with nested extbase plugins
Status:
New
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2016-01-08
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
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.
Actions