Issue Bug Closed

#91723Extbase configuration loader and/or AbstractController loads wrong configuration

S P 06/29/20, 09:55 updated 12/16/24, 11:28

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.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 6

  1. S P commented <span data-processor="relativetime" data-value="2020-06-29T11:00:15+00:00" > 06/29/20, 11:00 </span>

    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. S P commented <span data-processor="relativetime" data-value="2020-06-29T11:17:40+00:00" > 06/29/20, 11:17 </span>

    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. S P changed subject Extbase configuration loader for settings does not respect typeNum Extbase configuration loader and/or AbstractController loads wrong configuration <span data-processor="relativetime" data-value="2020-06-29T11:19:38+00:00" > 06/29/20, 11:19 </span>

  4. S P commented <span data-processor="relativetime" data-value="2020-07-03T13:22:42+00:00" > 07/03/20, 13:22 </span>

    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!)

  5. Oliver Bartsch commented and changed status New Closed <span data-processor="relativetime" data-value="2024-12-16T11:28:46+00:00" > 12/16/24, 11:28 </span>

    I’m closing as author reported this to work for latest versions. In case anyone stumbles over this again, please create a new issue, linking to this one.