Project

General

Profile

Actions

Bug #72600

open

Singleton ConfigurationManager creates problems with nested extbase plugins

Added by Robert Vock almost 9 years ago. Updated almost 6 years ago.

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.


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #82033: extbase parameters in FLUIDTEMPLATE : configuration lost for extension FormNew2017-08-03

Actions
Actions

Also available in: Atom PDF