97212[FEATURE] Introduce `EnumItemsProcessor` for TCA select fields
Commit message
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 2
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/12/97212/2 && git checkout FETCH_HEAD - Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/12/97212/2 && git cherry-pick FETCH_HEAD
Review
-
Code review CR 0 Needs a vote
-
Verified V 0 Needs a vote
- core-ci +1 CI
Merge conflicts 4
Issues 1
Files 11
- typo3/sysext/core/Classes/Database/Schema/DefaultTcaSchema.php+55 −0
- typo3/sysext/core/Classes/DataHandling/EnumItemsProcessor.phpnew+79 −0
- typo3/sysext/core/Classes/Type/LabelledEnumInterface.phpnew+28 −0
- typo3/sysext/core/Documentation/Changelog/15.0/Feature-111275-EnumItemsProcessorForTCASelectFields.rstnew+89 −0
- typo3/sysext/core/Tests/Unit/Database/Schema/DefaultTcaSchemaTest.php+105 −0
- typo3/sysext/core/Tests/Unit/DataHandling/Fixtures/Enums/IntBackedEnum.phpnew+24 −0
- typo3/sysext/core/Tests/Unit/DataHandling/Fixtures/Enums/LabelledIntBackedEnum.phpnew+31 −0
- typo3/sysext/core/Tests/Unit/DataHandling/Fixtures/Enums/NegativeIntBackedEnum.phpnew+24 −0
- typo3/sysext/core/Tests/Unit/DataHandling/Fixtures/Enums/StringBackedEnum.phpnew+24 −0
- typo3/sysext/core/Tests/Unit/DataHandling/Fixtures/Enums/UnitEnum.phpnew+24 −0
- typo3/sysext/core/Tests/Unit/DataHandling/EnumItemsProcessorTest.phpnew+148 −0
Review log 46
-
Elias Häußler uploaded patch set 1 10/29/26, 10:03
-
core-ci voted on patch set 1 V -1 10/29/26, 10:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112791
-
Elias Häußler uploaded patch set 2
V -110/29/26, 10:12 -
core-ci voted on patch set 2 V +1 10/29/26, 10:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/112792
-
Daniel Windloff commented on patch set 2 10/30/26, 06:31
I would suggest implementing a dedicated TCA type for enums. Integrating this into the existing `select` type could lead to various side effects—for instance, when combined with `foreign_table` or when modifying the `items` array via configuration. From my perspective, using a PHP enum implies the intent to have a fixed set of immutable values. Being able to validate against this exact list would be highly advantageous, particularly for mapping in Extbase and for validation within the DataHandler. Furthermore, configuration would be significantly simplified, as one would generally only need to specify the type and a single parameter for the enum itself and the behavior for different option like default or nullable could be definied properly. -
Garvin Hicking commented on patch set 2 10/30/26, 08:53
Reply Unresolved
I agree, I think a distinct type will have advantages in the future and a cleaner "intent". Not sure yet how much redundancy this will bring, maybe we'll need to move parts of the select-type to a re-usable service or (yuc) using a trait. I really like the direction and plan!