98363[FEATURE] Provide soft references as value objects
Commit message
Soft reference parsers return their matches as nested arrays, whose shape is documented in a class comment only. Every consumer has to know the keys, and the "type" of a substitution is checked against strings all over the place. SoftReferenceParserResult now provides the matches as SoftReference objects with an optional SoftReferenceSubstitution, which references a record or is a plain value (SoftReferenceTargetType). Parsers create the result from these objects with fromSoftReferences(), consumers read them with getSoftReferences(). Results created from arrays are converted, getMatchedElements() still returns the arrays. The email, URL, substitute and extension path parsers create value objects, and the reference index creates its rows from them. The array representation of ReferenceIndex::getRelations() stays as it is, since ext:impexp writes it into export files.
Show more Show less
Resolves: #111730 Related: #107184 Releases: main Change-Id: I7055ff7dab629561bf0920f32314067ab574c992
Test this change
Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch
- Check out patch set 3
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/63/98363/3 && git checkout FETCH_HEAD
- Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/63/98363/3 && git cherry-pick FETCH_HEAD
Review
-
Code review CR 0 Needs a vote
-
Verified V 0 Needs a vote
- core-ci +1 CI
Relation chain 5
- 98380[TASK] Deprecate the array representation of soft references
- 98379[FEATURE] Select linkvalidator linktypes by the link type
- 98378[TASK] Replace soft reference tokens in one place
- 98377[FEATURE] Provide soft references in AppendLinkHandlerElementsEvent
-
98363 [FEATURE] Provide soft references as value objects This change
Merge conflicts 3
Issues 2
Files 11
- typo3/sysext/core/Classes/Database/ReferenceIndex.php+41 −26
- typo3/sysext/core/Classes/DataHandling/SoftReference/EmailSoftReferenceParser.php+5 −9
- typo3/sysext/core/Classes/DataHandling/SoftReference/ExtensionPathSoftReferenceParser.php+2 −3
- typo3/sysext/core/Classes/DataHandling/SoftReference/SoftReference.phpnew+67 −0
- typo3/sysext/core/Classes/DataHandling/SoftReference/SoftReferenceParserResult.php+37 −1
- typo3/sysext/core/Classes/DataHandling/SoftReference/SoftReferenceSubstitution.phpnew+103 −0
- typo3/sysext/core/Classes/DataHandling/SoftReference/SoftReferenceTargetType.phpnew+36 −0
- typo3/sysext/core/Classes/DataHandling/SoftReference/SubstituteSoftReferenceParser.php+2 −11
- typo3/sysext/core/Classes/DataHandling/SoftReference/UrlSoftReferenceParser.php+5 −10
- typo3/sysext/core/Documentation/Changelog/15.0/Feature-111730-SoftReferencesAsValueObjects.rstnew+72 −0
- typo3/sysext/core/Tests/Unit/DataHandling/SoftReference/SoftReferenceParserResultTest.phpnew+106 −0
Review log 36
-
Benni Mack uploaded patch set 1 12/05/26, 12:51
-
core-ci voted on patch set 1 V +1 12/05/26, 13:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/116451
-
Benni Mack rebased onto patch set 2 12/05/26, 19:50
Copied Votes: * Verified+1 (copy condition: "**changekind:NO_CHANGE**") -
core-ci voted on patch set 2 V +1 12/05/26, 19:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/116468
-
Benni Mack uploaded patch set 3
V +112/05/26, 21:50 -
core-ci voted on patch set 3 V +1 12/05/26, 22:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/116474