Bug #91723
openExtbase configuration loader and/or AbstractController loads wrong configuration
0%
Description
The method getPluginConfiguration
in the class FrontendConfigurationManager
just fetches plugin.tx_plugin.settings
- it does not care about having multiple typeNum
. For example:
anotherPageObject < lib.basePageObject
anotherPageObject {
typeNum = 123
// 10 is the plugin
10 {
settings {
foo = bar
}
}
}
If I visit the same site on ?type=123
I only get the base settings, not the settings for this typeNum = 123
.
Updated by S P over 4 years ago
Did some further research. The problem is this in getConfiguration
:
if ($extensionName === null || $extensionName === $this->extensionName && $pluginName === $this->pluginName) {
$frameworkConfiguration = $this->getContextSpecificFrameworkConfiguration($frameworkConfiguration);
}
Up to this point everything is corect, but this writes the global plugin.tx_
over the already correct resolved settings. What is this for?
Also there are no parantheses around the logical operators - is the condition regarding the evaluation order of || and && even correct?
Updated by S P over 4 years ago
I'm not sure what the intention of this configuration spaghetti is, but the problem could also be that AbstractController loads the settings without $extensionName
and $pluginName
:
$this->settings = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS);
This eventually triggers the if clause and overwrites the plugin settings with the global settings.
Updated by S P over 4 years ago
- Subject changed from Extbase configuration loader for settings does not respect typeNum to Extbase configuration loader and/or AbstractController loads wrong configuration
Updated by S P over 4 years ago
Another onion layer adds to this whole spaghetti: the configuration gets cached in getConfiguration()
, but only by extension and plugin names:
$configurationCacheKey = strtolower(($extensionName ?: $this->extensionName) . '_' . ($pluginName ?: $this->pluginName));
if (isset($this->configurationCache[$configurationCacheKey])) {
return $this->configurationCache[$configurationCacheKey];
}
What if I have the same plugin multiple times on a page with different settings? Then always the config from the first will be loaded.
I debugegd this multiple days now and I simply can't get past this method to return the correct configuration, no matter what I do (even though in the Template module in the Backend everything is shown fully correct, so the TypoScript itself is fine!)