Task #83615

Specific exception in ArrayUtility::getValueByPath

Added by Christian Kuhn 11 months ago. Updated 11 months ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2018-01-19
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Sprint Focus:

Related issues

Related to TYPO3 Core - Bug #83590: Install tool fatal if 'EXTENSIONS' does not exist in LocalConfiguration Closed 2018-01-17
Related to TYPO3 Core - Task #83636: Specific exception in ArrayUtility::removeByPath() Closed 2018-01-22
Related to TYPO3 Core - Bug #83815: Use MissingArrayPathException in InheritancesResolverService Closed 2018-02-09

Associated revisions

Revision d0873491 (diff)
Added by Christian Kuhn 11 months ago

[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 <>
Tested-by: Frank Naegler <>
Reviewed-by: Mathias Brodala <>
Tested-by: TYPO3com <>
Tested-by: Mathias Brodala <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision 5312cb2b (diff)
Added by Christian Kuhn 11 months ago

[TASK] Specific exception in ArrayUtility::removeByPath()

Similar to getValueByPath(), removeByPath() now throws
a specific exception if the path to remove does not
exist in given array to avoid catching global \RuntimeException'
in consuming code.
The same "MissingArrayPathException" is used here since
both cases have identical semantic.

Change-Id: I69447c47d24e28110cf03929ea5ed28cf5e43024
Resolves: #83636
Related: #83615
Releases: master
Reviewed-on: https://review.typo3.org/55424
Tested-by: TYPO3com <>
Reviewed-by: Reiner Teubner <>
Reviewed-by: Helmut Hummel <>
Tested-by: Helmut Hummel <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>

Revision e835a1e1 (diff)
Added by Christian Kuhn 10 months ago

[BUGFIX] Use MissingArrayPathException in InheritancesResolverService

With change for issue #83238 the specific exception
MissingArrayPathException has been accidently changed
back to a generic \RuntimeException, fix this again.

Change-Id: I60f189c48a21bc7a6e648f4e811f4ae312ccc9ef
Releases: master
Resolves: #83815
Related: #83238
Related: #83615
Reviewed-on: https://review.typo3.org/55624
Tested-by: TYPO3com <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

History

#1 Updated by Christian Kuhn 11 months ago

  • Related to Bug #83590: Install tool fatal if 'EXTENSIONS' does not exist in LocalConfiguration added

#2 Updated by Gerrit Code Review 11 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55412

#3 Updated by Gerrit Code Review 11 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55412

#4 Updated by Gerrit Code Review 11 months ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55412

#5 Updated by Gerrit Code Review 11 months ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55412

#6 Updated by Gerrit Code Review 11 months ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55412

#7 Updated by Gerrit Code Review 11 months ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55412

#8 Updated by Gerrit Code Review 11 months ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55412

#9 Updated by Gerrit Code Review 11 months ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55412

#10 Updated by Christian Kuhn 11 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#11 Updated by Christian Kuhn 11 months ago

  • Related to Task #83636: Specific exception in ArrayUtility::removeByPath() added

#12 Updated by Gerrit Code Review 11 months ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/55424

#13 Updated by Susanne Moog 11 months ago

  • Category set to Backend API

#14 Updated by Christian Kuhn 10 months ago

  • Related to Bug #83815: Use MissingArrayPathException in InheritancesResolverService added

Also available in: Atom PDF