Commit 9f1a4f8c authored by Matthias Vogel's avatar Matthias Vogel Committed by Benni Mack
Browse files

[BUGFIX] Store extension configuration in key EXTENSIONS

The previous patch changed it to EXTCONF,
but this conflicts with other stuff.

Resolves: #82370
Releases: master
Change-Id: Ib515a1364f45739fb7f8e0fa3e781099f1c1a107
Reviewed-on: https://review.typo3.org/53999

Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent dec96109
......@@ -76,6 +76,7 @@ class ConfigurationManager
'EXTCONF',
'DB',
'SYS/caching/cacheConfigurations',
'EXTENSIONS',
];
/**
......
......@@ -16,7 +16,7 @@
* This file contains the default array definition that is
* later populated as $GLOBALS['TYPO3_CONF_VARS']
*
* The description of the various options is stored in the DefaultConfigurationDescription.php file
* The description of the various options is stored in the DefaultConfigurationDescription.yaml file
*/
return [
'GFX' => [ // Configuration of the image processing features in TYPO3. 'IM' and 'GD' are short for ImageMagick and GD library respectively.
......@@ -1125,5 +1125,5 @@ return [
'update' => [],
],
],
'SVCONF' => []
'SVCONF' => [],
];
......@@ -9,7 +9,7 @@ See :issue:`82254`
Description
===========
The extension configuration stored in $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'] has been deprecated and replaced by a plain array in $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'].
The extension configuration stored in $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'] has been deprecated and replaced by a plain array in $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'].
Affected Installations
......@@ -21,6 +21,6 @@ All extensions manually getting settings and unserializing them from $GLOBALS['T
Migration
=========
Switch to the use of $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'] instead and remove all unserialize calls.
Switch to the use of $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'] instead and remove all unserialize calls.
.. index:: LocalConfiguration, PHP-API, FullyScanned
\ No newline at end of file
.. index:: LocalConfiguration, PHP-API, FullyScanned
......@@ -11,7 +11,7 @@ Description
There is no reason to save the extension configuration as serialized values instead of an plain array. Arrays are easier to handle and there are already parts of the core using arrays (for example the avatar provider registration).
Therefore the API has been changed to store the extension configuration as an array in $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']. The configuration is merged on save with the default configuration and the full configuration is written to LocalConfiguration.
Therefore the API has been changed to store the extension configuration as an array in $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']. The configuration is merged on save with the default configuration and the full configuration is written to LocalConfiguration.
Impact
......@@ -19,4 +19,4 @@ Impact
Extension configuration can now be accessed as array directly, without calling unserialize(). The old and new API will co-exist in version 9.
.. index:: LocalConfiguration, PHP-API
\ No newline at end of file
.. index:: LocalConfiguration, PHP-API
......@@ -67,7 +67,7 @@ class ConfigurationUtility implements \TYPO3\CMS\Core\SingletonInterface
/** @var $configurationManager \TYPO3\CMS\Core\Configuration\ConfigurationManager */
$configurationManager = $this->objectManager->get(\TYPO3\CMS\Core\Configuration\ConfigurationManager::class);
$configurationManager->setLocalConfigurationValueByPath('EXT/extConf/' . $extensionKey, serialize($configuration));
$configurationManager->setLocalConfigurationValueByPath('EXTCONF/' . $extensionKey, $configuration);
$configurationManager->setLocalConfigurationValueByPath('EXTENSIONS/' . $extensionKey, $configuration);
}
/**
......@@ -80,14 +80,14 @@ class ConfigurationUtility implements \TYPO3\CMS\Core\SingletonInterface
{
$mergedConfiguration = $this->getDefaultConfigurationFromExtConfTemplateAsValuedArray($extensionKey);
// @deprecated loading serialized configuration is deprecated and will be removed in v10 - use EXTCONF array instead
// @deprecated loading serialized configuration is deprecated and will be removed in v10 - use EXTENSIONS array instead
// No objects allowed in extConf at all - it is safe to deny that during unserialize()
$legacyCurrentExtensionConfiguration = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$extensionKey], ['allowed_classes' => false]);
$legacyCurrentExtensionConfiguration = is_array($legacyCurrentExtensionConfiguration) ? $legacyCurrentExtensionConfiguration : [];
$mergedConfiguration = $this->mergeExtensionConfigurations($mergedConfiguration, $legacyCurrentExtensionConfiguration);
if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey]) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey])) {
$currentExtensionConfiguration = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey];
if (isset($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$extensionKey]) && is_array($GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$extensionKey])) {
$currentExtensionConfiguration = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$extensionKey];
$mergedConfiguration = $this->mergeExtensionConfigurations($mergedConfiguration, $currentExtensionConfiguration);
}
......
......@@ -95,7 +95,7 @@ class ConfigurationUtilityTest extends \TYPO3\TestingFramework\Core\Unit\UnitTes
];
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$extensionKey] = serialize($serializedConfiguration);
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$extensionKey] = $currentExtconfConfiguration;
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][$extensionKey] = $currentExtconfConfiguration;
$actual = $configurationUtility->getCurrentConfiguration($extensionKey);
$this->assertEquals($expected, $actual);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment