Project

General

Profile

Actions

Bug #91723

open

Extbase configuration loader and/or AbstractController loads wrong configuration

Added by Stefan P almost 4 years ago. Updated almost 4 years ago.

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

0%

Estimated time:
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.

Actions #1

Updated by Stefan P almost 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?

Actions #2

Updated by Stefan P almost 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.

Actions #3

Updated by Stefan P almost 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
Actions #4

Updated by Stefan P almost 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!)

Actions

Also available in: Atom PDF