Bug #59662
closedProblem with subsequent calls to $configurationManager->setLocalConfigurationValueByPath and 'LocalConfiguration invalid'
0%
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.
Updated by Markus Klein over 10 years ago
- Assignee set to Christian Kuhn
@Christian: Can you please comment on that. thanks
Updated by Markus Klein over 10 years ago
Wolfgang, looking at the trace: Are you writing to the LocalConfiguration in the AdditionalConfiguration file?
Updated by Markus Klein over 10 years ago
- Status changed from New to Needs Feedback
If so, take a look at my comment here: https://forge.typo3.org/issues/60294#note-11
Updated by Alexander Opitz almost 10 years ago
- Status changed from Needs Feedback to Closed
- Assignee deleted (
Christian Kuhn)
No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.
Updated by Georg Ringer about 3 years ago
- Related to Bug #95111: "Feature Toggles" with file OPcaching disabled doesn't work added