Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.
90690[FEATURE] Allow converting objects to other objects
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 6
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/90/90690/6 && git checkout FETCH_HEAD - Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/90/90690/6 && git cherry-pick FETCH_HEAD
Review
-
Code review CR 0 Needs a vote
-
Verified V 0 Needs a vote
- core-ci +1 CI
Issues 1
Files 8
- typo3/sysext/core/Documentation/Changelog/15.0/Feature-107462-ExtbaseTypeConvertersShouldSupportConvertingOneObjectIntoAnother.rstnew+107 −0
- typo3/sysext/extbase/Classes/Property/PropertyMapper.php+4 −1
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/type_converter_test/Classes/Domain/Dto/ArticleDto.phpnew+33 −0
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/type_converter_test/Classes/Domain/Model/Article.phpnew+33 −0
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/type_converter_test/Classes/Property/TypeConverter/DtoTypeConverter.phpnew+36 −0
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/type_converter_test/Configuration/Services.yaml+7 −0
- typo3/sysext/extbase/Tests/Functional/Property/PropertyMapperTest.php+20 −20
- typo3/sysext/extbase/Tests/Functional/Property/PropertyMapperWithDatabaseTest.phpnew+49 −0
Review log 1318
-
Simon Schaufelberger uploaded patch set 1 09/15/25, 23:26
-
core-ci voted on patch set 1 V -1 09/15/25, 23:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/84998
-
Simon Schaufelberger uploaded patch set 2
V -109/16/25, 10:01 -
core-ci voted on patch set 2 V +1 09/16/25, 10:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85020
-
Garvin Hicking commented on patch set 2 09/16/25, 10:20
Please add a commit message body shortly explaining the commitFeature-107462-TypeConvertersShouldSupportConvertingOneObjectIntoAnother.rst:6Mention "Extbase" in the titleFeature-107462-TypeConvertersShouldSupportConvertingOneObjectIntoAnother.rst:14Also mention "Extbase" here. Also, the later code uses the "PropertyMapper" and not specifically a "TypeConverter" so maybe both terms could briefly be explained here? As a ready I wonder what the specific TypeConverter would be - is it an own one? A core one? Which one from the Core? Adding the code example of the actual typeconverter and/or service YAML config would make this more complete I think -
Simon Schaufelberger uploaded patch set 3
V +109/18/25, 14:57 -
Simon Schaufelberger commented on patch set 2 09/18/25, 14:57
Feature-107462-TypeConvertersShouldSupportConvertingOneObjectIntoAnother.rst:6ReplyDoneFeature-107462-TypeConvertersShouldSupportConvertingOneObjectIntoAnother.rst:14ReplyI hope it is better now. -
Simon Schaufelberger commented on patch set 3 09/18/25, 14:58
Reply
Done -
Stefan Froemken commented on patch set 3 CR -1 09/18/25, 15:46
Feature-107462-ExtbaseTypeConvertersShouldSupportConvertingOneObjectIntoAnother.rst:63Wrong namespaceFeature-107462-ExtbaseTypeConvertersShouldSupportConvertingOneObjectIntoAnother.rst:69Wrong classnameFeature-107462-ExtbaseTypeConvertersShouldSupportConvertingOneObjectIntoAnother.rst:77PropertyMapper mapps data from Request (original is STRING or ARRAY) into a specific data type. The origin can never be an object. And PropertyMapping should be handled before the action call and not from within. Looks like using tools for the wrong context. -
Garvin Hicking commented on patch set 3 09/18/25, 15:53
Feature-107462-TypeConvertersShouldSupportConvertingOneObjectIntoAnother.rst:14Reply UnresolvedHonestly I'm still trying to grasp the concept for this. The way I use typeConverters is on request-level, which mainly knows int/string/null/array basic types and can convert those (like time integers to a date object) When I deal with DTOs I usually use the datamapper in my own service classes, or even in a repository or the action. Also, usually I have a model's "createFromDto()" method that returns a self instance accessing the getters of the DTO and the setters of the target object. That leaves more freedom to do calucations and transformations, because usually a DTO is not really 1:1 mappable to my final objects. I see the "straight" ability here to use a typeconverter like you do, but it somehow feels like breaking a "blood/brain" barrier when dealing with request input. I wonder if we should keep that intact and recommend other patterns to deal with object transformation. I don't feel authoritative enough to decide if this still can be beneficial / is valid, so I'd love to hear some more thoughts. -
Simon Schaufelberger commented on patch set 3 09/18/25, 22:18
Feature-107462-ExtbaseTypeConvertersShouldSupportConvertingOneObjectIntoAnother.rst:63ReplyDoneFeature-107462-ExtbaseTypeConvertersShouldSupportConvertingOneObjectIntoAnother.rst:69ReplyDoneFeature-107462-ExtbaseTypeConvertersShouldSupportConvertingOneObjectIntoAnother.rst:77ReplyPropertyMapper CAN map data from a request but is not limited to it. It has no requirement that the data is coming from a request. It can also be used manually to map any input source into another. I'm using the PropertyMapper intensively in my own projects to also map raw database data into a model for example data from the Doctrine QueryBuilder without all the extbase stuff involved. Maybe that is not the best approach for you but for me it is. -
Simon Schaufelberger uploaded patch set 4
CR -109/18/25, 22:19 -
core-ci voted on patch set 4 V +1 09/18/25, 22:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85136
-
Stefan Bürk commented on patch set 4 09/19/25, 13:15
Feature-107462-ExtbaseTypeConvertersShouldSupportConvertingOneObjectIntoAnother.rst:77Reply UnresolvedNot checked this out deeper, but already had this on a todo for extension to look into things like that and implementend something. However, just asking, instead doing that on that low level .. would it not more reasonable to have a look into symfonys 7.3 ObjectMapper feature (albeit beeing marked as experiemental) and having a "type converter" dispatching to object manager stuff ... https://symfony.com/doc/current/object_mapper.html At least I had that in the look, but not suitable for the extension to do older TYPO3 version support reauired not having that symfony version on board. On the other hand .. must this really be part / a type converter or would not just the object mapper a better abroach to be used within a action to transform/map the data from the passed DTO to the persisting Domain Model object ? oO Don't get me wrong .. just looked 5 seks into this change and only wanted to share question and pointing out to ObjectMapper if that would make (more) sense. Maybe that would help to have only a generic tpeconverter and having the "configuration" on the object level with the map attributes from ObjectMapper or something like that. Not sure if you had/have the new ObjectMapper on the table or if that is coming for a long time usage in extensions. Maybe worth to (re)think about it ? Not sure ... -
Simon Schaufelberger uploaded patch set 5
V +105/09/26, 18:06 -
core-ci voted on patch set 5 V +1 05/09/26, 18:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/101755
-
Simon Schaufelberger uploaded patch set 6
V +109/04/26, 22:04 -
core-ci voted on patch set 6 V +1 09/04/26, 22:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107908