Bug #91723

Extbase configuration loader and/or AbstractController loads wrong configuration

Added by Stefan P 13 days ago. Updated 9 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2020-06-29
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.

History

#1 Updated by Stefan P 13 days 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?

#2 Updated by Stefan P 13 days 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.

#3 Updated by Stefan P 13 days ago

  • Subject changed from Extbase configuration loader for settings does not respect typeNum to Extbase configuration loader and/or AbstractController loads wrong configuration

#4 Updated by Stefan P 9 days 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!)

Also available in: Atom PDF