Issue Bug Closed

#59662Problem with subsequent calls to $configurationManager->setLocalConfigurationValueByPath and 'LocalConfiguration invalid'

Wolfgang Klinger 06/19/14, 11:55 updated 12/05/14, 14:19

Description

We ran into problems when using subsequent calls to

$configurationManager->setLocalConfigurationValueByPath(‘… any key …’, ‘… some value …’);

in AdditionalConfiguration.php.
The problem (it seems, I debugged it and came to this conclusion) is that LocalConfiguration.php is sometimes not fully written to disk when read in again.
As require(LocalConfiguration.php) … returns 1 instead of the configuration array if no return statement exists TYPO3 throws the following exception:

( ! ) Catchable fatal error: Argument 1 passed to TYPO3\CMS\Core\Utility\ArrayUtility::setValueByPath() must be an array, integer given, called in /private/var/www/typo3_src-6.2.3/typo3/sysext/core/Classes/Configuration/ConfigurationManager.php on line 229 and defined in /private/var/www/typo3_src-6.2.3/typo3/sysext/core/Classes/Utility/ArrayUtility.php on line 189
Call Stack
#    Time    Memory    Function    Location
1    0.0003    657712    {main}( )    ../backend.php:0
2    0.0004    672296    require_once( '/private/var/www/typo3_src-6.2.3/typo3/init.php' )    ../backend.php:27
3    0.0197    4797200    TYPO3\CMS\Core\Core\Bootstrap->loadConfigurationAndInitialize( ???, ??? )    ../init.php:61
4    0.0204    4838976    TYPO3\CMS\Core\Core\Bootstrap->populateLocalConfiguration( )    ../Bootstrap.php:227
5    0.0204    4838976    TYPO3\CMS\Core\Configuration\ConfigurationManager->exportConfiguration( )    ../Bootstrap.php:392
6    0.0225    5027640    require( '/private/var/www/…/typo3conf/AdditionalConfiguration.php' )    ../ConfigurationManager.php:286
7    0.0231    5091192    TYPO3\CMS\Core\Configuration\ConfigurationManager->setLocalConfigurationValueByPath( string(13), string(1) )    ../AdditionalConfiguration.php:46
8    0.0242    5094104    TYPO3\CMS\Core\Utility\ArrayUtility::setValueByPath( long, string(13), string(1), ??? )    ../ConfigurationManager.php:229

I solved it in our project by creating an array at first and then using setLocalConfigurationValuesByPathValuePairs once.
I think it needs some locking mechanism here.

Reviews 0

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