[TASK] Specific exception in ArrayUtility::getValueByPath() 12/55412/9
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 19 Jan 2018 13:34:21 +0000 (14:34 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Fri, 19 Jan 2018 15:08:52 +0000 (16:08 +0100)
commitd087349106bfcf7c88569e6420c5a5c90d0fae4f
treebf4a84b2b75c32dec927e237c6c15f86cf0e7d71
parent033a5922f9e153f1f48b2ad276e05cac990eb455
[TASK] Specific exception in ArrayUtility::getValueByPath()

If ArrayUtility::getValueByPath() does not find a given
path in an array structure, it currently throws a generic
\RuntimeException. Checking the path is one of the key
components of the method and consuming code may not know
if the path exists at all, which is fine.

Throwing global \RuntimeException thus forces various
places to catch \RuntimeException which possibly
hides away programming errors and mis-uses.

The patch makes getValueByPath() throw a specific exception
if path does not exists. Catching that specific exception
reduces the number of global 'catch \RuntimeException'
significantly.

The patch also adds another catch in early install tool
to fix a not recoverable fatal if LocalConfiguration
'EXTENSIONS' array does not yet exist, for instance if
upgrading from v8 to v9.

Change-Id: If65b1b6ba2181b4cd7de2ce41776c0d78a5b513f
Resolves: #83615
Resolves: #83590
Releases: master
Reviewed-on: https://review.typo3.org/55412
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Tested-by: Mathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
16 files changed:
typo3/sysext/core/Classes/Utility/ArrayUtility.php
typo3/sysext/core/Classes/Utility/Exception/MissingArrayPathException.php [new file with mode: 0644]
typo3/sysext/core/Tests/Unit/Utility/ArrayUtilityTest.php
typo3/sysext/extbase/Classes/Mvc/Web/RequestBuilder.php
typo3/sysext/form/Classes/Domain/Finishers/AbstractFinisher.php
typo3/sysext/form/Classes/Domain/Finishers/FinisherVariableProvider.php
typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php
typo3/sysext/form/Classes/Domain/Runtime/FormState.php
typo3/sysext/form/Classes/Hooks/DataStructureIdentifierHook.php
typo3/sysext/form/Classes/Mvc/Configuration/InheritancesResolverService.php
typo3/sysext/form/Classes/Service/TranslationService.php
typo3/sysext/install/Classes/Configuration/AbstractPreset.php
typo3/sysext/install/Classes/Controller/LayoutController.php
typo3/sysext/install/Classes/Service/SilentConfigurationUpgradeService.php
typo3/sysext/install/Classes/Updates/WizardDoneToRegistry.php
typo3/sysext/install/Tests/Unit/Service/SilentConfigurationUpgradeServiceTest.php