Project

General

Profile

Actions

Bug #87057

closed

Plugin added via TypoScript throws an error.

Added by Anu Bhuvanendran Nair over 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Target version:
-
Start date:
2018-12-03
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
Tags:
TYPO3,TypoScript
Complexity:
medium
Is Regression:
Sprint Focus:

Description

In TYPO3 v9, plugin added via typoScript throws an exception, ie 'Default controller for the plugin cannot be determined. Please check configurePlugin in ext_localconf.php'.

Usually, there will be a spelling mistake or syntax error which leads to this category of error. But this time it is not. The same plugin runs flawlessly as a content element in the page.
On further investigation, found out that function getConfiguration() in 'sysext/extbase/Classes/Configuration/AbstractConfigurationManager.php', reads two config arrays regarding the plugin which is $frameworkConfiguration[] and $pluginConfiguration[]. In case of plugin added via typoScript, frameworkConfiguration array fails to fetch the default controller from ext_localconf.php which in turn leads to this error.

#1316104317 TYPO3\CMS\Extbase\Mvc\Exception
The default controller for extension "*****" and plugin "*****" can not be determined. Please check for TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin() in your ext_localconf.php.

Below is the TS code added in root.

page.1000 = USER
page.1000 {
 userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
 extensionName = *****
 pluginName = *****
 vendorName = ******
 settings {
   flexform {
     compliance = opt-in
     link {
       value = a_random_page_id
     }
   }
 }
}

Please find below, the code from which the mentioned error is being generated. sysext/extbase/Classes/Configuration/AbstractConfigurationManager.php


    /**
     * Loads the Extbase Framework configuration.
     *
     * The Extbase framework configuration HAS TO be retrieved using this method, as they are come from different places than the normal settings.
     * Framework configuration is, in contrast to normal settings, needed for the Extbase framework to operate correctly.
     *
     * @param string $extensionName if specified, the configuration for the given extension will be returned (plugin.tx_extensionname)
     * @param string $pluginName if specified, the configuration for the given plugin will be returned (plugin.tx_extensionname_pluginname)
     * @return array the Extbase framework configuration
     */
    public function getConfiguration($extensionName = null, $pluginName = null)
    {

     ....

        \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($frameworkConfiguration, $pluginConfiguration);
        // only load context specific configuration when retrieving configuration of the current plugin
        if ($extensionName === null || $extensionName === $this->extensionName && $pluginName === $this->pluginName) {
            $frameworkConfiguration = $this->getContextSpecificFrameworkConfiguration($frameworkConfiguration);
        }

        //Patch added by PITS 09/11/18
        if(empty($frameworkConfiguration['controllerConfiguration'])){
            $frameworkConfiguration['controllerConfiguration'] = $pluginConfiguration['controllerConfiguration'];
        }
    ....
    }

Actions

Also available in: Atom PDF