85046[FEATURE] Automatically resolve relations for records
Commit message
Review
-
Code review CR +2 Done
- Oli Bartsch +2
- Benjamin Franzke +1
- Nikita Hovratov +1
-
Verified V +2 Done
- Oli Bartsch +2
- Benjamin Franzke +1
- Nikita Hovratov +1
- core-ci +1 CI
Issues 3
Files 97
- typo3/sysext/backend/Classes/Preview/FluidBasedContentPreviewRenderer.php2+4 −1
- typo3/sysext/backend/Classes/Preview/StandardContentPreviewRenderer.php4+103 −57
- typo3/sysext/backend/Classes/Utility/BackendUtility.php+1 −0
- typo3/sysext/backend/Classes/View/Drawing/BackendLayoutRenderer.php+1 −1
- typo3/sysext/core/Classes/Collection/LazyRecordCollection.php3new+98 −0
- typo3/sysext/core/Classes/Configuration/Tca/TcaPreparation.php8+41 −6
- typo3/sysext/core/Classes/Database/ReferenceIndex.php+1 −1
- typo3/sysext/core/Classes/Database/RelationHandler.php+1 −1
- typo3/sysext/core/Classes/DataHandling/DataHandler.php+1 −2
- typo3/sysext/core/Classes/DataHandling/RecordFieldTransformer.php38new+248 −0
- typo3/sysext/core/Classes/DataHandling/RelationResolver.php2new+148 −0
- typo3/sysext/core/Classes/Domain/Persistence/GreedyDatabaseBackend.phpnew+163 −0
- typo3/sysext/core/Classes/Domain/Record.php+19 −4
- typo3/sysext/core/Classes/Domain/RecordFactory.php+94 −23
- typo3/sysext/core/Classes/Domain/RecordPropertyClosure.phpnew+35 −0
- typo3/sysext/core/Classes/Resource/Collection/LazyFileReferenceCollection.phpnew+96 −0
- typo3/sysext/core/Classes/Resource/Collection/LazyFolderCollection.phpnew+96 −0
- typo3/sysext/core/Classes/Schema/Field/DateTimeFieldType.php+5 −0
- typo3/sysext/core/Classes/Schema/FieldTypeFactory.php+5 −4
- typo3/sysext/core/Classes/Schema/FlexFormSchema.php+18 −0
Show 77 more files
- typo3/sysext/core/Classes/Schema/FlexFormSchemaFactory.php+39 −2
- typo3/sysext/core/Classes/Schema/RelationMap.php+7 −14
- typo3/sysext/core/Classes/Schema/RelationshipType.php+32 −11
- typo3/sysext/core/Configuration/TCA/Overrides/sys_file_metadata.php+1 −1
- typo3/sysext/core/Configuration/TCA/Overrides/sys_file_reference.php+1 −1
- typo3/sysext/core/Configuration/TCA/be_users.php+1 −1
- typo3/sysext/core/Configuration/TCA/pages.php+3 −3
- typo3/sysext/core/Configuration/TCA/sys_file.php+1 −1
- typo3/sysext/core/Configuration/TCA/sys_filemounts.php+1 −1
- typo3/sysext/core/Configuration/TCA/sys_file_collection.php+1 −1
- typo3/sysext/core/Configuration/TCA/sys_file_reference.php+1 −1
- typo3/sysext/core/Documentation/Changelog/13.3/Feature-103581-AutomaticallyTransformTCAFieldValuesForRecordObjects.rstnew+159 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/category_many_to_many.csvnew+18 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/category_many_to_many_localized.csvnew+18 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/category_one_to_many.csvnew+8 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/category_one_to_one.csvnew+7 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/circular_relation.csvnew+6 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/collections.csvnew+16 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/collections_recursive.csvnew+17 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/db_reference_hidden.csvnew+10 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/db_relation.csvnew+9 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/db_relations.csvnew+17 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/db_relation_mm.csvnew+12 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/db_relation_multiple.csvnew+8 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/db_relation_recursive.csvnew+14 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/file_reference.csvnew+9 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/file_references.csvnew+17 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/folder_files.csvnew+3 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/foreign_table_select_multiple.csvnew+14 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/select_foreign.csvnew+9 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/select_foreign_native.csvnew+4 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/select_foreign_recursive.csvnew+13 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/DataSet/select_one_to_one.csvnew+9 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/TestFolder/sub/subfile.jpgnew+0 −0
- typo3/sysext/core/Tests/Functional/DataHandling/Fixtures/TestFolder/file.jpgnew+0 −0
- typo3/sysext/core/Tests/Functional/DataHandling/RecordFieldTransformerTest.phpnew+1210 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_classic_content/Configuration/TCA/test_content_carousel_item.php+1 −1
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_relation_resolver/Configuration/TCA/Overrides/tt_content.phpnew+461 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_relation_resolver/Configuration/TCA/collection_inner.phpnew+64 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_relation_resolver/Configuration/TCA/record_collection.phpnew+61 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_relation_resolver/Configuration/TCA/test_record.phpnew+77 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_relation_resolver/Configuration/TCA/typo3tests_contentelementb_collection.phpnew+64 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_relation_resolver/Configuration/TCA/typo3tests_contentelementb_collection_recursive.php2new+73 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_relation_resolver/composer.jsonnew+14 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_relation_resolver/ext_emconf.phpnew+18 −0
- typo3/sysext/core/Tests/Unit/Configuration/Tca/TcaPreparationTest.php+53 −2
- typo3/sysext/core/Tests/Unit/Domain/RecordFactoryTest.php+4 −3
- typo3/sysext/core/Tests/Unit/Schema/RelationshipTypeTest.php+13 −5
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_post.php+3 −3
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/parent_child_translation/Configuration/TCA/tx_parentchildtranslation_domain_model_main.php+1 −1
- typo3/sysext/felogin/Configuration/TCA/Overrides/fe_groups.php+1 −1
- typo3/sysext/felogin/Configuration/TCA/Overrides/fe_users.php+1 −1
- typo3/sysext/frontend/Classes/Content/RecordCollector.php+10 −8
- typo3/sysext/frontend/Classes/DataProcessing/PageContentFetchingProcessor.php+2 −6
- typo3/sysext/frontend/Classes/DataProcessing/RecordTransformationProcessor.php+2 −2
- typo3/sysext/frontend/Classes/Typolink/TypolinkParameter.php+1 −1
- typo3/sysext/frontend/Configuration/TCA/backend_layout.php+1 −1
- typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/PageContentProcessor/Partials/SingleContent.html+3 −0
- typo3/sysext/frontend/Tests/Functional/DataProcessing/Fixtures/RecordTransform/Partials/SingleContent.html+3 −0
- typo3/sysext/frontend/Tests/Functional/DataProcessing/PageContentFetchingProcessorTest.php+1 −0
- typo3/sysext/frontend/Tests/Functional/DataProcessing/RecordTransformationProcessorTest.php+3 −1
- typo3/sysext/indexed_search/Configuration/TCA/index_config.php+1 −1
- typo3/sysext/reactions/Configuration/TCA/Overrides/sys_reaction_create_record.php+1 −1
- typo3/sysext/reactions/Configuration/TCA/sys_reaction.php+1 −1
- typo3/sysext/styleguide/Classes/TcaDataGenerator/FieldGenerator/TypeInlineFalSelectSingle12Foreign.php+1 −1
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_folder.php+2 −2
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_group.php+2 −2
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_imagemanipulation.php+3 −3
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_select.php+4 −4
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_select_single_12_foreign.php+1 −1
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_inline_1nnol10n.php+1 −1
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_inline_11.php+1 −1
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_inline_mngroup_mm.php+2 −4
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_inline_mnsymmetricgroup_mm.php+2 −2
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_inline_usecombinationgroup_mm.php+1 −1
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_required.php+4 −4
- typo3/sysext/workspaces/Classes/Hook/DataHandlerHook.php+2 −2
Review log 131195
Show 113170 earlier messages
-
Benni Mack uploaded patch set 1 07/01/24, 13:07
-
core-ci voted on patch set 1 V -1 07/01/24, 13:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60773
-
Benni Mack uploaded patch set 2
V -107/11/24, 18:25 -
core-ci voted on patch set 2 V -1 07/11/24, 18:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61406
-
Benni Mack uploaded patch set 3
V -107/11/24, 20:44 -
core-ci voted on patch set 3 V -1 07/11/24, 20:52 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61415
-
Benni Mack rebased onto patch set 4
V -107/11/24, 22:26 -
core-ci voted on patch set 4 V -1 07/11/24, 22:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61419
-
Benni Mack uploaded patch set 5
V -107/12/24, 06:33 -
core-ci voted on patch set 5 V -1 07/12/24, 06:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61452
-
Benni Mack uploaded patch set 6
V -107/12/24, 23:24 -
core-ci voted on patch set 6 V -1 07/12/24, 23:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61516
-
Benni Mack uploaded patch set 7
V -107/12/24, 23:45 -
core-ci voted on patch set 7 V +1 07/12/24, 23:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61517
-
Benni Mack uploaded patch set 8
V +107/12/24, 23:51 -
core-ci voted on patch set 8 V -1 07/12/24, 23:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61518
-
Benni Mack uploaded patch set 9
V -107/17/24, 14:16 -
core-ci voted on patch set 9 V -1 07/17/24, 14:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61695
-
Benni Mack uploaded patch set 10
V -107/17/24, 14:31 -
core-ci voted on patch set 10 V -1 07/17/24, 14:39 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61697
-
Oli Bartsch uploaded patch set 11
V -107/18/24, 10:54 -
core-ci voted on patch set 11 V -1 07/18/24, 11:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61739
-
Oli Bartsch uploaded patch set 12
V -107/29/24, 07:34 -
core-ci voted on patch set 12 V -1 07/29/24, 07:41 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62362
-
Benni Mack uploaded patch set 13
V -108/07/24, 16:20 -
core-ci voted on patch set 13 V -1 08/07/24, 16:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63005
-
Benni Mack uploaded patch set 14
V -108/08/24, 23:16 -
core-ci voted on patch set 14 V -1 08/08/24, 23:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63096
-
Benni Mack uploaded patch set 15
V -108/09/24, 09:00 -
core-ci voted on patch set 15 V -1 08/09/24, 09:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63122
-
Benni Mack uploaded patch set 16
V -108/09/24, 10:43 -
core-ci voted on patch set 16 V +1 08/09/24, 10:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63128
-
Benni Mack uploaded patch set 17
V +108/09/24, 12:54 -
core-ci voted on patch set 17 V +1 08/09/24, 13:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63139
-
Benni Mack uploaded patch set 18
V +108/09/24, 13:25 -
core-ci voted on patch set 18 V +1 08/09/24, 13:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63141
-
Nikita Hovratov uploaded patch set 19
V +108/10/24, 21:37 -
core-ci voted on patch set 19 V +1 08/10/24, 21:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63172
-
Nikita Hovratov commented on patch set 19 CR -1 08/10/24, 23:05
Testing with Content Blocks currently. -
Nikita Hovratov uploaded patch set 20
CR -1V +108/11/24, 10:46 -
Nikita Hovratov commented on patch set 20 08/11/24, 10:48
LazyRecordCollection.php:83I changed this method to allow to modify the entries with another RecordInterface. This is needed for Content Blocks, as it decorates "Record" with "ContentBlockData" and overrides it. -
core-ci voted on patch set 20 V +1 08/11/24, 10:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63189
-
Nikita Hovratov commented on patch set 20 08/11/24, 12:10
RecordFieldTransformer.php:72FieldTypeFactory->createFieldType does not apply `columnsOverrides`. This leads to `$fieldInformation->getConfiguration()` not containing possible maxitems overrides and thus inconsistent data handling. I suppose we need to manually get the merged columns overrides array based on the context of the sub-schema. -
Nikita Hovratov commented on patch set 20 08/11/24, 12:22
RecordFieldTransformer.php:103This is a problem. If the record data of a 1:1 / n:1 relation is empty (=null), we don't have any RawRecord for the initialized Ghost object. This means every call will result in some uninitialized property error. Do we need a NullRecord perhaps? -
Nikita Hovratov commented on patch set 20 08/11/24, 12:24
RecordFieldTransformer.php:162As discussed in Slack: The array of parameters is pretty useless in frontend context when trying to use TypoLink VH. A parameter object would be cool, which the VH also understands. -
Nikita Hovratov commented on patch set 20 08/11/24, 12:44
phpstan-baseline.neon:274Can we get rid of new stan errors? -
Oli Bartsch uploaded patch set 21
V +108/13/24, 10:22 -
core-ci voted on patch set 21 V +1 08/13/24, 10:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63293
-
Oli Bartsch uploaded patch set 22
V +108/13/24, 14:57 -
core-ci voted on patch set 22 V +1 08/13/24, 15:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63325
-
Oli Bartsch uploaded patch set 23
V +108/14/24, 11:50 -
core-ci voted on patch set 23 V -1 08/14/24, 11:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63372
-
Oli Bartsch rebased onto patch set 24
V -108/16/24, 08:23 -
core-ci voted on patch set 24 V -1 08/16/24, 08:32 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63561
-
Oli Bartsch uploaded patch set 25
V -108/16/24, 08:47 -
core-ci voted on patch set 25 V -1 08/16/24, 09:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63562
-
Oli Bartsch uploaded patch set 26
V -108/16/24, 11:27 -
core-ci voted on patch set 26 V -1 08/16/24, 11:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63576
-
Oliver Klee commented on patch set 26 08/16/24, 13:17
LazyRecordCollection.php:96typo: Remvoing -> Removing -
Oli Bartsch uploaded patch set 27
V -108/16/24, 13:36 -
core-ci voted on patch set 27 V +1 08/16/24, 13:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63580
-
Oli Bartsch commented on patch set 27 08/16/24, 13:44
phpstan-baseline.neon:274ReplyDoneLazyRecordCollection.php:96ReplyDoneRecordFieldTransformer.php:72ReplyDoneRecordFieldTransformer.php:103ReplyDoneRecordFieldTransformer.php:162ReplyDone -
Oli Bartsch uploaded patch set 28
V +108/16/24, 14:34 -
core-ci voted on patch set 28 V -1 08/16/24, 14:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63587
-
core-ci voted on patch set 28 V +1 08/16/24, 14:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63587
-
Nikita Hovratov commented on patch set 28 CR +1 V +1 08/16/24, 15:00
Amazing! Thanks to all! -
Oli Bartsch uploaded patch set 29
CR +1V +108/16/24, 23:44 -
core-ci voted on patch set 29 V +1 08/16/24, 23:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63599
-
Oliver Klee commented on patch set 29 08/17/24, 18:29
RelationResolver.php:68We can make the type even more specific: ``` @return list<array{table: string, row: array<string, mixed>}> ``` -
Oli Bartsch uploaded patch set 30
V +108/19/24, 06:39 -
Oli Bartsch commented on patch set 30 08/19/24, 06:40
RelationResolver.php:68ReplyDone -
core-ci voted on patch set 30 V +1 08/19/24, 06:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63749
-
Oli Bartsch uploaded patch set 31
V +108/19/24, 08:51 -
core-ci voted on patch set 31 V +1 08/19/24, 08:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63756
-
Oli Bartsch voted on patch set 31 CR +1 V +1 08/19/24, 09:02
-
Nikita Hovratov commented on patch set 31 08/19/24, 18:28
RecordFieldTransformer.php:79We discussed this in our Content Blocks meeting today. So this differs from our implementation: It doesn't matter what is defined for maxitems: file, select and group are always a Collection no matter what. Only exception we made is selectSingle. Reason: A change in TCA maxitems has a direct influence in how templates need to be build. This behavior is unforseeable and can lead to frustration. I would rather avoid this and have less "beautiful" templates that unexpected behavior. -
André Buchmann commented on patch set 31 08/19/24, 19:40
RecordFieldTransformer.php:79ReplyI get your reasoning to remove the maxitems logic. None the less I opt to keep it. By setting maxitems=1 I expect to get only one result, just like with renderType=selectSingle. It also enables a generic way for custom renderType definitions to create the non-collection behaviour for relations. -
Nikita Hovratov commented on patch set 31 08/20/24, 06:38
RecordFieldTransformer.php:79ReplyHi Andre, yes, at first thought this might make more sense and looks better in the template. However, changes in maxitems will always be breaking. 1. Your own templates will need adaption. 2. Your code needs adaption. 3. You can't use partials at all (Think about the Gallery partial, which supports 1 or more images) 4. Changing maxitems in third-party extensions will break 1. and 2. and you can't easily fix it. The only exception I would make is type select with renderType selectSingle. This really means it is only possible to have 1 value logically. From own experience, it happens more than often that requirements change and you have to allow multiple images or something similar. Such a change will cost more time (and money). At last, Content Blocks already has this behavior and it works great. There was nobody complaining not having a non-collection. And upgrades will be smoother for current users when we integrate this. -
Oli Bartsch uploaded patch set 32
CR +1V +108/20/24, 07:24 -
core-ci voted on patch set 32 V +1 08/20/24, 07:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63806
-
Oli Bartsch commented on patch set 32 08/20/24, 07:32
RecordFieldTransformer.php:79ReplyI have updated the patch. Let's wait for some feedback from @benni@typo3.org -
André Buchmann commented on patch set 32 08/20/24, 11:20
RecordFieldTransformer.php:79ReplyHeyho Nikita, totally agree with the cost efficiency point for changing requirements. Changing maxitems to something bigger than 1 would cause a adaption of the templates. The same argument can be provided for the renderType. Requirement changes can lead to changes in the renderType from a single selection to a multi select or the other way round. I actually had this case already. Why not provide relational fields always as collections? That way you can be sure to get always the same data structure event after "small" interface changes for the editor. -
Nikita Hovratov commented on patch set 32 08/20/24, 11:37
RecordFieldTransformer.php:79ReplyThe select field currently has the problem that it does not define cardinality by its type. Type "select" can be anything 1:1, 1:n or n:1 depending on how the user works with it. So the renderType "selectSingle" is the only indicator for a n:1 relation we have right now. This is sub-optimal of course. My vision is to split type select into "selectOne" and "selectMultiple". Then you can use the type to determine, if you have an array of items or not. RenderTypes can still be there to either have a "selectSingle", "sideBySide", etc for "selectOne" and everything except "selectSingle" for "selectMultiple". Having this in mind, the best option is to use "selectSingle" as indicator for now and later to migrate it to type "selectOne". This means using either type is a hard opt-in and changing it later leads to changes in code. So the clever developer should use "selectMultiple(SideBySide)" with "maxitems: 1", if he thinks requirements might change. -
Oli Bartsch commented on patch set 32 08/20/24, 12:23
RecordFieldTransformer.php:79Reply+100 for finally resolving the renderType=selectSingle. This bothers me since we migrated all those renderTypes and "eval" options of type input to dedicated types. selectSingle might be (not sure at the moment) the last renderType which needs to be checked for data processing. renderType's however were introduced for FormEngine display purposes only. https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Configuration/Tca/TcaPreparation.php#L346 -
Benni Mack commented on patch set 32 08/20/24, 17:54
RecordFieldTransformer.php:79ReplyI do understand this makes the whole templating part easier, and plus, (at least that's my understanding) we're backwards-compatible with existing CB templates. I however think that resolving a 1:1 relation as a collection is semantically wrong. I mean, even people in Extbase don't make this a ObjectStorage but a relation to a single object. Next to the use-case you mentioned with "select" I also consider a group field to one single record not a collection. If I have a DB field "Responsible BE User" pointing to a be user object, I don't want a collection. at all. So this is two-fold and depending on the use-case. So, if we can agree that a) there is a semantic difference between 1:1 (maxitems = 1) and 1:n (maxitems != 1) b) the topic is about making templating easier / "non-breaking" and adding compat with CB <= 0.7) then we might find a solution. -
Nikita Hovratov commented on patch set 32 08/20/24, 18:10
RecordFieldTransformer.php:79Reply> a) there is a semantic difference between 1:1 (maxitems = 1) and 1:n (maxitems != 1) I wouldn't make it dependent on maxitems. If at all, we need to introduce another TCA option "relationship" like with type "category". Reason: In some cases I want to override other extensions with "maxitems: 1", eventhough it is a Collection. This shall not be breaking in the extensions code and might be unexpected. So maxitems is in my opinion a poor man's solution to this problem that we should avoid at all cost. > b) the topic is about making templating easier / "non-breaking" and adding compat with CB <= 0.7) yes, the non-breaking part is the most important. Having compat to CB is a bonus. -
Benni Mack commented on patch set 32 08/20/24, 18:14
RecordFieldTransformer.php:79ReplyBecause then I would solve it like this: we _could_ add a custom Iterator to the RecordLazyGhost, which would then return the actual Record object (which would then only be one record object) and we could iterate the same way as iterating over the Collection. I agree that we should add a new TCA option and unify this feature set, let's also consult Olly Hader for this. -
Nikita Hovratov commented on patch set 32 08/20/24, 18:22
RecordFieldTransformer.php:79ReplyIf I understand you correctly, I then have the option to use it directly or as a Collection, depending on if I want to keep it non-breaking for outside (or own) changes? This could be a good compromise for people who want clean (and semantically correct) code and for extension authors deciding to keep their code compatible for TCA overrides. -
Nikita Hovratov commented on patch set 32 08/20/24, 18:35
RecordFieldTransformer.php:79ReplyAh, now I get it. When I have a collection and then override it to only allow 1 value, then the custom iterator kicks in and it works. When I start out with only 1 value and then remove the restriction for 1 value, then it's breaking. But I could write my code from the beginning as a collection, eventhough I only allow 1 value in case the requirements change. Then no code changes would be necessary. -
Oli Bartsch uploaded patch set 33
V +108/21/24, 14:25 -
Oli Bartsch commented on patch set 33 08/21/24, 14:26
RecordFieldTransformer.php:79ReplyHi @benni@typo3.org @nikita.h@live.de, I've updated the patch, please have a look. -
Oli Bartsch uploaded patch set 34 08/21/24, 14:30
-
core-ci voted on patch set 33 V -1 08/21/24, 14:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63915
-
core-ci voted on patch set 34 V +1 08/21/24, 14:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63916
-
Nikita Hovratov commented on patch set 34 08/21/24, 17:19
RecordFieldTransformer.php:94We need a NullRecord just like for normal Records here.RecordFieldTransformer.php:113We need a NullRecord just like for normal Records here.RecordLazyGhost.php:30We need \Countable interface as well.FileReferenceLazyGhost.php:25We need \Countable interface as well.FolderLazyGhost.php:25We need \Countable interface as well. -
Nikita Hovratov commented on patch set 34 08/21/24, 17:20
RecordFieldTransformer.php:79ReplyThis looks alright to me. See my comments for new findings I had. -
Nikita Hovratov updated the commit message in patch set 35
V +108/21/24, 17:21 -
core-ci voted on patch set 35 V +1 08/21/24, 17:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63927
-
Oli Bartsch uploaded patch set 36
V +108/22/24, 06:37 -
core-ci voted on patch set 36 V +1 08/22/24, 06:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63957
-
Oli Bartsch commented on patch set 36 08/22/24, 06:45
RecordFieldTransformer.php:94ReplyThis seems to be not as easy as it sounds since the $instance is always a FileReference. For Records, we also return a record while setting the NullRecord only instead of the RawRecord. This is different to the FileReference where we would need to "fake" a reference due to the internal logic e.g. accessing a original file.RecordFieldTransformer.php:113ReplySame problem as with FileReferenceRecordLazyGhost.php:30ReplyDoneFileReferenceLazyGhost.php:25ReplyDoneFolderLazyGhost.php:25ReplyDone -
Nikita Hovratov commented on patch set 36 08/22/24, 07:11
RecordFieldTransformer.php:94ReplyAcknowledgedRecordFieldTransformer.php:113ReplyAcknowledged -
Nikita Hovratov voted on patch set 36 V +1 08/22/24, 08:24
-
Oli Bartsch voted on patch set 36 CR +1 V +1 08/22/24, 16:09
-
Nikita Hovratov uploaded patch set 37
CR +1V +108/22/24, 17:36 -
core-ci voted on patch set 37 V +1 08/22/24, 17:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64005
-
Nikita Hovratov commented on patch set 37 08/22/24, 17:47
RecordFieldTransformer.php:79ReplyUnfortunately, the LazyGhost objects still make trouble. There is no way to know, if there is a filled record behind the ghost or nothing (no set). Here an example: ``` <f:if condition="{data.record}"> Record: {data.record.title} </f:if> ``` The condition will always be `true` as it is an object no matter what. The workaround could be: ``` <f:if condition="{data.record.uid}"> Record: {data.record.title} </f:if> ``` But this is not how people are used to it (e.g. in extbase). Same problem of course with FileReference. There one must check for `{image.originalFile}` as image will always be an uninitialized FileReference. In ContentBlocks I can circumvent this in my ContentBlockDataDecorator where I can check for `NullRecord` and `FileReference->getOriginalFile()` in the code. However, this leads of course to the lazy thing not being used at all. -
Nikita Hovratov commented on patch set 37 08/22/24, 17:51
FluidBasedContentPreviewRenderer.php:94This could lead in seldom cases that `record` from the `$row` is overridden. But only if someone defined such a custom column. Maybe we can just ignore it, as it is such an unlikely event. What do you think? -
Nikita Hovratov commented on patch set 37 08/22/24, 20:29
FluidBasedContentPreviewRenderer.php:94ReplyWe ignore this and make it in v14 the only variable as breaking change. -
Benjamin Franzke uploaded patch set 38
V +108/23/24, 09:43 -
Benjamin Franzke uploaded patch set 39 08/23/24, 09:50
-
core-ci voted on patch set 38 V -1 08/23/24, 09:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64059
-
core-ci voted on patch set 39 V +1 08/23/24, 09:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64060
-
Oliver Klee wrote 08/23/24, 10:06
Removed cc Oliver Klee. -
Benjamin Franzke uploaded patch set 40
V +108/23/24, 11:35 -
core-ci voted on patch set 40 V +1 08/23/24, 11:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64064
-
Benjamin Franzke uploaded patch set 41
V +108/23/24, 12:04 -
core-ci voted on patch set 41 V +1 08/23/24, 12:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64067
-
Benjamin Franzke uploaded patch set 42
V +108/23/24, 14:09 -
core-ci voted on patch set 42 V -1 08/23/24, 14:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64083
-
Benjamin Franzke uploaded patch set 43
V -108/23/24, 14:24 -
core-ci voted on patch set 43 V +1 08/23/24, 14:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64085
-
Benjamin Franzke uploaded patch set 44
V +108/23/24, 15:25 -
Benjamin Franzke commented on patch set 44 08/23/24, 15:27
RecordFieldTransformer.php:125@benni@typo3.org I'd like to discuss with you whether `RecordInterface` is fine to be returned here. I added that in https://review.typo3.org/c/Packages/TYPO3.CMS/+/85046/43..44 because non `Record` instances were wrapped into the lazy record proxy. My guess is: That wrapping only happens because the LadyRecordProxy was too inflexible and therefore that was done. Therefore I started to allow `RecordInterface` to be returned here. (Although I think currently no code puts non `Record` objects into the record identity map) -
Nikita Hovratov commented on patch set 44 08/23/24, 15:27
RecordFieldTransformer.php:79ReplyDone -
Benjamin Franzke commented on patch set 44 08/23/24, 15:32
RecordFieldTransformer.php:79Reply> Unfortunately, the LazyGhost objects still make trouble Ack, I came to the same conclusion, which is why lazy 1:* relations are now handled by the Record object instead of proxies.RecordFieldTransformer.php:125Replyacked by benni via slack -
core-ci voted on patch set 44 V -1 08/23/24, 15:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64087
-
Nikita Hovratov commented on patch set 44 08/23/24, 15:35
RecordFieldTransformer.php:79ReplyWe did a full cycle with fixing bugs and at the end we are again at the start of this discussion. The workaround with \IteratorInterface now doesn't work anymore. Ok, so fine. As long as we keep in mind that we should mid-term introduce said TCA options for relationships, we can go with that. The ultimate goal should be to allow maxitems: 1 and a "oneToMany" relation like it is possible in extbase. As it is easy to break templates/code, this needs a prominent warning in the rst. I will document this as a breaking change in the next Content Blocks release. -
Benjamin Franzke uploaded patch set 45
V -108/23/24, 15:38 -
core-ci voted on patch set 45 V +1 08/23/24, 15:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64088
-
Benjamin Franzke commented on patch set 45 08/23/24, 15:52
RecordFieldTransformer.php:79ReplyImplementing iterators is only half of the story, then you'd also need `ArrayAccess`, because templates may use `foo.image.0`… I'm really against workarounds in a new implementation, sorry. I think the real curlpit is that the relation type is derived from `maxitems=1`. That is way too implicit and should probably be reconsidered. I'm in favor of an explicit configuration option and personally think common things like `.image` and `.assets` should always resolve to collections. …but this is just my opinion. -
Nikita Hovratov commented on patch set 45 08/23/24, 16:10
RecordFieldTransformer.php:79ReplyFull ack. I didn't have the direct access in mind, thanks. With .image and .assets always resolve to collection, I agree. I can imagine them having the "oneToMany" relationship option later, so it is derived from this. Overrides of this option should be discouraged. This would be like overriding the TCA type. -
Nikita Hovratov uploaded patch set 46
V +108/24/24, 00:53 -
core-ci voted on patch set 46 V +1 08/24/24, 01:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64105
-
Nikita Hovratov uploaded patch set 47
V +108/24/24, 01:35 -
core-ci voted on patch set 47 V +1 08/24/24, 01:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64107
-
Nikita Hovratov commented on patch set 47 08/24/24, 02:25
RecordFieldTransformer.php:79ReplyHey, so I just did that. The problem is, if we don't do it now, we will have breaking changes later. Summary of my changes: - Introduce TCA option "relationship" for all "relation" type fields. - Change all "maxitems: 1" occurences to "relationship: 'oneToOne'" - Add TcaPreparation for "relationship: 'oneToOne'" to "maxitems: 1" - Adjust TcaPreparation of "renderType: 'selectSingle'" to "relationship: 'oneToOne'" (but only, if relationship is not set already) - Only use relationship to determine cardinality in FieldTransformer. - Adjust rst accordingly. Now the separation between maxitems and cardinality is clean. Current Content Blocks templates won't break either. Please, if I did forget something hit me up. I also wish this patch to finally go through. I will do the best to my abilities to make everything right. -
Nikita Hovratov voted on patch set 47 CR +1 V +1 08/24/24, 02:25
-
Benni Mack commented on patch set 47 08/24/24, 15:51
Thanks for your much appreciated effort, Nikita. Fine by me with the changes, we just need to be sure to document them (and I assume we need to evaluate this somewhere in DataHandler and Extbase as well at a later stage)! -
Oliver Klee commented on patch set 47 08/24/24, 16:06
Are we sure that all relations marked as "oneToOne" are actually 1:1 relationships and not n:1 relationships (e.g., where pages are referenced)? -
Oliver Klee commented on patch set 47 08/24/24, 16:07
Reply
For example, the fe_groups.felogin_redirectPid looks more like an n:1 relationship than a 1:1 relationship. -
Christian Kuhn commented on patch set 47 08/25/24, 11:50
StandardContentPreviewRenderer.php:91DI possible?typo3tests_contentelementb_collection_recursive.php:67we shouldn't need the columns enabled in ctrl anymore.ext_tables.sql:3we shouldn't need these anymore. -
Oli Bartsch uploaded patch set 48
CR +1V +108/25/24, 13:46 -
Oli Bartsch uploaded patch set 49 08/25/24, 13:53
-
core-ci voted on patch set 48 V +1 08/25/24, 13:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64156
-
Oli Bartsch commented on patch set 49 08/25/24, 13:55
StandardContentPreviewRenderer.php:91ReplyUnfortunately this class is not internal and actively extended, even by Core (`FormPagePreviewRenderer`).typo3tests_contentelementb_collection_recursive.php:67ReplyDoneext_tables.sql:3ReplyDone -
core-ci voted on patch set 49 V +1 08/25/24, 14:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64157
-
Oliver Klee commented on patch set 49 08/25/24, 15:46
Reply
If we're treating n:1 and 1:1 relations the same as far as the left side of the relation is concerned (as it seems), maybe we can rename this to "toOne" in order to make this correct and less confusing? -
Benjamin Franzke commented on patch set 49 08/26/24, 06:42
RecordFieldTransformer.php:79Replythanks for the immediate effort Nikita, sounds great to me! -
Benjamin Franzke commented on patch set 49 08/26/24, 07:30
Reply
ack, we should add `manyToOne` as well, and basically set it most of the times, as the relations that were changed are actually manyToOne, I only found one exception: `sys_file_metadata.metadata => sys_file_metadata` which is a true 1:1 relation. ``` be_users.avatar => file sys_file_metadata.l10n_parent => sys_file_metadata sys_file_reference.l10n_parent => sys_file_reference pages.shortcut => pages pages.content_from_pid => pages pages.mount_pid => pages 1:1! sys_file.metadata => sys_file_metadata sys_file_collection.folder_identifier => folder sys_file_reference.uid_local => sys_file sys_filemounts.identifier => folder fe_groups.felogin_redirectPid => pages fe_users.felogin_redirectPid => pages backend_layout.icon => file index_config.alternative_source_pid => pages reactions.storage_pid => pages reactions.impersonate_user => be_user ``` I'd support both, `manyToOne` and `oneToOne`, and having them explicit will allow for proper introspection via TcaSchema API. -
Nikita Hovratov commented on patch set 49 08/26/24, 08:55
Reply
TCA type category has "relationship" "oneToOne" eventhough it is technically "manyToOne": https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ColumnsConfig/Type/Category/Index.html#confval-category-relationship I'm not sure if we really need this distinction for TcaSchema. Would this be somehow used in the future? I think this could be a case, where we could keep it simple instead of 100% technically correct. Otherwise, we would need to streamline type category as well or this would lead to confusion. -
Oli Bartsch uploaded patch set 50
V +108/26/24, 10:02 -
core-ci voted on patch set 50 V -1 08/26/24, 10:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64192
-
Christian Kuhn commented on patch set 50 08/26/24, 10:24
StandardContentPreviewRenderer.php:91Replythen use an inject* method and leave a comment this is done because the class is not a leaf class so other classes that extend can use __construct() without calling parent::__construct(). (just as note, you can leave that out in this patch, i don't insist on this since the change is about a different thing and we could quite easily change this details later. if so, closes comment. if you find the time, change it). -
Benjamin Franzke uploaded patch set 51
V -108/26/24, 10:56 -
Oliver Klee commented on patch set 51 08/26/24, 11:01
TcaPreparation.php:3342 typos: ``` * Add "'relationship' => 'manyToOne" to all "'type' => 'select'" column fields with "'renderType' => 'selectSingle'". ``` -
core-ci voted on patch set 51 V +1 08/26/24, 11:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64196
-
Benjamin Franzke uploaded patch set 52
V +108/26/24, 11:48 -
Benjamin Franzke commented on patch set 52 08/26/24, 11:48
Reply
Let's go for the clean api for new types right away and treat category as before. Documentation is already pretty good in outlining that the naming is wrong and that can be clarified there, that the relationship properties are badly named.StandardContentPreviewRenderer.php:91ReplyI of course fully agree lolli, but would resolve because the class already does this "wrong" for `GeneralUtility::makeInstance(IconFactory::class)`, which means we'd have to refactor some non-relevant cases. That makes it better suited for a separate TASK to streamline this class to use DI.TcaPreparation.php:334ReplyDone -
core-ci voted on patch set 52 V +1 08/26/24, 11:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64199
-
Nikita Hovratov commented on patch set 52 08/26/24, 12:14
TcaPreparation.php:347This should be foreign_table I believe. -
Benjamin Franzke commented on patch set 52 CR -1 08/26/24, 12:51
TcaPreparation.php:347Replyupfront: i think we messed up since patchset 47 and somewhere confused manyToOne with oneToMany. The idea to check for `foreign_field` was to check for `many` to apply, but that's `oneToMany` then, but we've now written `manyToOne`. I think we got confused by the `ToOne` debate. It's not about to-one, but `FromOne`. I'm going to rethink all changes since patchset 47 now. Sorry. (And for reference, I wanted to exclude mm cases like typo3/sysext/backend/Tests/Functional/Fixtures/Extensions/test_tca_select_items/Configuration/TCA/tca_select_items.php `mm_field`) -
Benjamin Franzke uploaded patch set 53
CR -1V +108/26/24, 14:00 -
Benjamin Franzke uploaded patch set 54 08/26/24, 14:14
-
core-ci voted on patch set 53 V -1 08/26/24, 14:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64208
-
Oli Bartsch uploaded patch set 55 08/26/24, 14:17
-
core-ci voted on patch set 54 V -1 08/26/24, 14:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64210
-
core-ci voted on patch set 55 V -1 08/26/24, 14:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64211
-
Oli Bartsch uploaded patch set 56
V -108/26/24, 15:56 -
core-ci voted on patch set 56 V -1 08/26/24, 16:07 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64224
-
Oli Bartsch uploaded patch set 57
V -108/26/24, 16:20 -
core-ci voted on patch set 57 V +1 08/26/24, 16:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64229
-
Nikita Hovratov commented on patch set 57 08/26/24, 16:35
TcaPreparation.php:347ReplyDone -
Nikita Hovratov commented on patch set 57 08/26/24, 16:41
TcaPreparation.php:358There is no foreign_field option for select as far as I know. So no true oneToMany is possible, only a list of uids. -
Benjamin Franzke uploaded patch set 58
V +108/26/24, 17:28 -
Benjamin Franzke commented on patch set 58 08/26/24, 17:28
TcaPreparation.php:347ReplyDoneTcaPreparation.php:358Replythanks, too bad. Removed that for now. -
Benjamin Franzke uploaded patch set 59 08/26/24, 17:32
-
core-ci voted on patch set 58 V +1 08/26/24, 17:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64237
-
core-ci voted on patch set 59 V +1 08/26/24, 17:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64238
-
Benjamin Franzke uploaded patch set 60
V +108/26/24, 17:51 -
Benjamin Franzke commented on patch set 60 08/26/24, 17:51
RecordFieldTransformer.php:175if `nullable=true` is set in configuration, `0` needs to be interpreted as `01.01.1970`, not as `null` -
core-ci voted on patch set 60 V +1 08/26/24, 17:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64239
-
Benjamin Franzke uploaded patch set 61
V +108/26/24, 18:52 -
Benjamin Franzke commented on patch set 61 08/26/24, 18:52
RecordFieldTransformer.php:175ReplyDone -
core-ci voted on patch set 61 V +1 08/26/24, 18:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64248
-
Nikita Hovratov uploaded patch set 62
CR +1V +108/26/24, 19:46 -
core-ci voted on patch set 62 V +1 08/26/24, 19:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64249
-
Nikita Hovratov voted on patch set 62 CR +1 V +1 08/26/24, 19:55
-
Oli Bartsch uploaded patch set 63
CR +1V +108/26/24, 21:17 -
core-ci voted on patch set 63 V +1 08/26/24, 21:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64255
-
Oli Bartsch voted on patch set 63 CR +1 V +1 08/26/24, 21:25
-
Benjamin Franzke voted on patch set 63 CR +1 V +1 08/27/24, 03:01
-
Nikita Hovratov voted on patch set 63 CR +1 V +1 08/27/24, 06:25
-
Oli Bartsch voted on patch set 63 CR +2 V +2 08/27/24, 06:27
-
Oli Bartsch merged patch set 64 08/27/24, 06:27