86177[FEATURE] New TCA type "country"
Commit message
Review
-
Code review CR +2 Done
- Georg Ringer +2
- Benni Mack +1
-
Verified V +2 Done
- Georg Ringer +2
- Benni Mack +1
- core-ci +1 CI
Issues 3
Files 41
- Build/Sources/TypeScript/backend/form-engine/element/select-country-element.tsnew+82 −0
- typo3/sysext/backend/Classes/Form/Element/SelectCountryElement.php4new+231 −0
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaCountry.phpnew+155 −0
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaRecordTitle.php+34 −0
- typo3/sysext/backend/Classes/Form/Processor/SelectItemProcessor.php+4 −2
- typo3/sysext/backend/Classes/Form/NodeFactory.php+1 −0
- typo3/sysext/backend/Classes/Utility/BackendUtility.php+7 −0
- typo3/sysext/backend/Resources/Public/JavaScript/form-engine/element/select-country-element.jsnew+13 −0
- typo3/sysext/backend/Tests/Functional/Form/FormDataProvider/TcaCountryTest.phpnew+184 −0
- typo3/sysext/backend/Tests/Functional/Form/FormDataProvider/TcaRecordTitleTest.phpnew+125 −0
- typo3/sysext/core/Classes/Country/Country.php+7 −0
- typo3/sysext/core/Classes/Database/Schema/DefaultTcaSchema.php4+12 −0
- typo3/sysext/core/Classes/DataHandling/DataHandler.php2+10 −0
- typo3/sysext/core/Classes/DataHandling/RecordFieldTransformer.php+8 −0
- typo3/sysext/core/Classes/DataHandling/TableColumnType.php+1 −0
- typo3/sysext/core/Classes/Schema/Field/CountryFieldType.phpnew+31 −0
- typo3/sysext/core/Classes/Schema/FieldTypeFactory.php+2 −0
- typo3/sysext/core/Configuration/DefaultConfiguration.php+12 −0
- typo3/sysext/core/Documentation/Changelog/14.0/Feature-99911-NewTCATypeCountry.rst7new+447 −0
- typo3/sysext/core/Resources/Private/Language/locallang_core.xlf+6 −0
Show 21 more files
- typo3/sysext/core/Tests/Functional/DataHandling/RecordFieldTransformerTest.php+73 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_relation_resolver/Configuration/TCA/Overrides/tt_content.php+16 −1
- typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/ColumnMapFactory.php+10 −0
- typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapper.php+14 −0
- typo3/sysext/extbase/Classes/Property/TypeConverter/CountryConverter.phpnew+61 −0
- typo3/sysext/extbase/Classes/Utility/TypeHandlingUtility.php+1 −1
- typo3/sysext/extbase/Configuration/Services.yaml+7 −0
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Domain/Model/Person.php+13 −0
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Configuration/TCA/tx_blogexample_domain_model_person.php+9 −1
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Resources/Private/Language/locallang_db.xlf+3 −0
- typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/Fixtures/TcaTypeCountryTestImport.csvnew+4 −0
- typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/ColumnMapFactoryTest.php+1 −0
- typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/TcaTypeCountryTest.phpnew+84 −0
- typo3/sysext/extbase/Tests/Functional/Property/TypeConverter/CountryConverterTest.phpnew+60 −0
- typo3/sysext/extbase/Tests/Unit/Persistence/Generic/Mapper/DataMapperTest.php+2 −0
- typo3/sysext/extbase/Tests/Unit/Property/TypeConverter/CountryConverterTest.phpnew+65 −0
- typo3/sysext/lowlevel/Classes/Controller/DatabaseIntegrityController.php+2 −0
- typo3/sysext/styleguide/Classes/TcaDataGenerator/FieldGenerator/TypeCountry.phpnew+48 −0
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_select.php+121 −0
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_required.php+64 −1
- typo3/sysext/styleguide/Configuration/Services.yaml+3 −0
Review log 5186
Show 3461 earlier messages
-
Garvin Hicking uploaded patch set 1 09/18/24, 09:25
-
core-ci voted on patch set 1 V +1 09/18/24, 09:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66113
-
Garvin Hicking uploaded patch set 2
V +109/18/24, 09:32 -
Garvin Hicking updated the commit message in patch set 3 09/18/24, 09:36
follow up docs -
core-ci voted on patch set 3 V -1 09/18/24, 09:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66115
-
core-ci voted on patch set 2 V -1 09/18/24, 09:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66114
-
Garvin Hicking uploaded patch set 4
V -109/18/24, 11:36JS module and bugfix -
core-ci voted on patch set 4 V +1 09/18/24, 11:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66122
-
Garvin Hicking updated the commit message in patch set 5
V +109/18/24, 12:07 -
core-ci voted on patch set 5 V +1 09/18/24, 12:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66131
-
Garvin Hicking uploaded patch set 6
V +109/19/24, 09:43Add TcaRecordTitle implementation and test -
core-ci voted on patch set 6 V -1 09/19/24, 09:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66192
-
Garvin Hicking uploaded patch set 7
V -109/19/24, 09:59Some missing DB declarations -
Garvin Hicking uploaded patch set 8 09/19/24, 10:00
CGL -
core-ci voted on patch set 7 V -1 09/19/24, 10:14 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66194
-
core-ci voted on patch set 8 V +1 09/19/24, 10:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/66195
-
Georg Ringer uploaded patch set 9
V +101/22/25, 17:53 -
core-ci voted on patch set 9 V -1 01/22/25, 17:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72876
-
Georg Ringer uploaded patch set 10
V -101/22/25, 18:15 -
Georg Ringer uploaded patch set 11 01/22/25, 18:18
-
core-ci voted on patch set 10 V -1 01/22/25, 18:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72880
-
core-ci voted on patch set 11 V +1 01/22/25, 18:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72881
-
Georg Ringer uploaded patch set 12
V +101/22/25, 20:18 -
core-ci voted on patch set 12 V -1 01/22/25, 20:24 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72883
-
Georg Ringer uploaded patch set 13
V -101/22/25, 20:30 -
core-ci voted on patch set 13 V +1 01/22/25, 20:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72884
-
Garvin Hicking updated the commit message in patch set 14
V +101/23/25, 20:26 -
core-ci voted on patch set 14 V +1 01/23/25, 20:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72936
-
Garvin Hicking uploaded patch set 15
V +101/23/25, 21:49Styleguide examples required evaluation plus tests styleguide generator with random values -
core-ci voted on patch set 15 V +1 01/23/25, 21:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72937
-
Garvin Hicking uploaded patch set 16
V +101/24/25, 08:10Adjust flexforms -
core-ci voted on patch set 16 V +1 01/24/25, 08:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72956
-
Garvin Hicking uploaded patch set 17
V +101/24/25, 09:36Extbase implementation wip -
core-ci voted on patch set 17 V -1 01/24/25, 09:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72960
-
Garvin Hicking uploaded patch set 18
V -101/24/25, 10:55CGL -
core-ci voted on patch set 18 V -1 01/24/25, 11:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72968
-
Garvin Hicking uploaded patch set 19
V -101/24/25, 12:39Extbase property an data mapping -
core-ci voted on patch set 19 V -1 01/24/25, 12:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72971
-
Garvin Hicking uploaded patch set 20
V -101/24/25, 12:57CGL and test fix -
core-ci voted on patch set 20 V +1 01/24/25, 13:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72972
-
Garvin Hicking commented on patch set 21
V +101/24/25, 22:33Published edit on patch set 20. -
core-ci voted on patch set 21 V +1 01/24/25, 22:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72985
-
Torben Hansen commented on patch set 21 01/26/25, 11:09
SelectCountryElement.php:80`$table` and `$field` are not used anywhere and can be removed.SelectCountryElement.php:124This assignment must only be performed, when `$selected = true`, because else, the icon of the last item in `$selectedItems` will be used as flag icon of the select box.Feature-99911-NewTCATypeCountry.rst:161We should provide an example on how to use the counties in a CRUD scenario. Assign countries for select field in controller action: ``` $this->view->assignMultiple([ 'countries' => GeneralUtility::makeInstance(CountryProvider::class)->getAll(), ]); ``` Additionally, it should be named, that it is the responsibility of the extension developer to limit countries to the available options defined in TCA. It must also be mentioned, that extension developers must filter out non available countries when saving a record, since the TypeConverter will simply convert any provided valid alpha2 country string to a country object. As an example, if it is limited so select `DE, CH, AT` in frontend, it is still possible to save `US` as valid value to the record.Feature-99911-NewTCATypeCountry.rst:169For the Fluid example, we should also show how to define a select field for countries. Example: ``` <f:form.select property="country" options="{countries}" optionLabelField="name" optionValueField="alpha2IsoCode" value="{item.country.alpha2IsoCode}" /> ``` Is must be mentioned, that the property `country` is providing a `TYPO3\CMS\Core\Country\Country` object, which is not an extbase dopmain model and thereby works different when used in a fluid form. The example above shows, that getters are named different (e.g. `getAlpha2` does not exist but `getAlpha2IsoCode` is available instead). Additionally, the `TYPO3\CMS\Core\Country\Country` object has no `__toString` function, which requires special value assignment when used as property in a fluid select field (see example). Should we maybe add a `__toString` method to the class providing the `$alpha2`? -
Garvin Hicking commented on patch set 21 01/26/25, 12:06
Feature-99911-NewTCATypeCountry.rst:161ReplyGood point! Actually I'd say we should be able to retrieve the restriction/filter from the TCA config and apply sanitization? Not sure if this should happen out of the box or only when using a Validator annotation (which needs to be added then, too), what do you think? -
Daniel Windloff commented on patch set 21 01/27/25, 12:54
DataHandler.php:2430If only one country has been selected, why should multiple countries occur here as a comma-separated list? Furthermore, the validation, that the country is in the known list of countries should be added.DefaultTcaSchema.php:1030I suggest dropping the nullable here and creating notnull with default ''. Otherwise, the option nullable should be mentioned in the feature rst file. -
Garvin Hicking uploaded patch set 22
V +101/31/25, 16:34Apply code review suggestions -
Garvin Hicking commented on patch set 22 01/31/25, 16:38
SelectCountryElement.php:80ReplyTrue, thanks!SelectCountryElement.php:124ReplyOMG. I stumbled accross this myself before I saw your comment and spent half an hour on getting to the root of this, only to now see you found and fixed it already. Thanks! :-*DataHandler.php:2430ReplyGood catch; this was a copy+paste from the existing select and possible forward compatibility. I added a todo note and removed this for now to not cause confusion.DefaultTcaSchema.php:1030ReplyThank you, that is a good suggestion, changed this. Also I enlarged the field because if people add their "own" countries through the TCA abilities, 2 characters were not enough.Feature-99911-NewTCATypeCountry.rst:161ReplyWe discussed this a bit. The problem of tightly coupling TCA to extbase defaults would set a precedent which is not a common pattern for now. Instead, validation by custom domain logic is preferable. I will try to work out a "best practice" example for this.Feature-99911-NewTCATypeCountry.rst:169ReplyI will adapt the example together with an example extension. Adding "__toString" also sounds interesting, I will investigate this. -
core-ci voted on patch set 22 V +1 01/31/25, 16:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73281
-
Garvin Hicking uploaded patch set 23
V +101/31/25, 17:07Clarify expanding countries -
core-ci voted on patch set 23 V +1 01/31/25, 17:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73283
-
Garvin Hicking uploaded patch set 24
V +101/31/25, 21:06toString method plus dummy extension -
core-ci voted on patch set 24 V +1 01/31/25, 21:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73293
-
Garvin Hicking uploaded patch set 25
V +102/01/25, 21:20Rework RST -
Garvin Hicking commented on patch set 25 02/01/25, 21:21
Feature-99911-NewTCATypeCountry.rst:161ReplyI've (hugely) reworked the ReST file and create a dummy example to showcase this. I hope I addressed all of these remarks.Feature-99911-NewTCATypeCountry.rst:169ReplyAdapted the ReST and added `__toString`. I also point to the existing f:form.countrySelect VH which does the population of the options. -
core-ci voted on patch set 25 V +1 02/01/25, 21:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/73319
-
Georg Ringer voted on patch set 25 CR +1 V +1 02/03/25, 18:39
-
Georg Ringer uploaded patch set 26
CR +1V +102/18/25, 18:25 -
core-ci voted on patch set 26 V -1 02/18/25, 18:31 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74341
-
Georg Ringer uploaded patch set 27
V -102/18/25, 19:25 -
core-ci voted on patch set 27 V +1 02/18/25, 19:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74344
-
Simon Schaufelberger commented on patch set 27 03/23/25, 19:29
@gh@faktor-e.de Can you please rebase?
-
Garvin Hicking uploaded patch set 28
V +103/24/25, 16:55 -
core-ci voted on patch set 28 V -1 03/24/25, 17:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76154
-
Garvin Hicking uploaded patch set 29
V -103/24/25, 17:14 -
core-ci voted on patch set 29 V +1 03/24/25, 17:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76157
-
Garvin Hicking commented on patch set 29 03/24/25, 17:24
Reply
Done -
Garvin Hicking commented on patch set 29 03/27/25, 16:12
https://review.typo3.org/c/Packages/TYPO3.CMS/+/88774 needs integration here -
Benni Mack uploaded patch set 30
V +103/27/25, 20:14 -
core-ci voted on patch set 30 V -1 03/27/25, 20:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76503
-
Benni Mack uploaded patch set 31
V -103/27/25, 20:33 -
core-ci voted on patch set 31 V -1 03/27/25, 20:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76506
-
Benni Mack uploaded patch set 32
V -103/27/25, 20:47 -
core-ci voted on patch set 32 V -1 03/27/25, 20:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76511
-
Garvin Hicking uploaded patch set 33
V -103/28/25, 08:29 -
core-ci voted on patch set 33 V +1 03/28/25, 08:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76556
-
Garvin Hicking uploaded patch set 34
V +104/01/25, 09:02 -
Garvin Hicking commented on patch set 34 04/01/25, 09:03
Reply
Actually the main bug with icons as already addressed inside the variant of the SelectElement here, so no need for more. -
core-ci voted on patch set 34 V +1 04/01/25, 09:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76765
-
Garvin Hicking rebased onto patch set 35
V +104/01/25, 16:25 -
core-ci voted on patch set 35 V +1 04/01/25, 16:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/76803
-
Benni Mack voted on patch set 35 CR +1 V +1 04/01/25, 18:37
-
Georg Ringer voted on patch set 35 CR +2 V +2 04/02/25, 04:38
-
Georg Ringer merged patch set 36 04/02/25, 04:38
-
Benjamin Franzke commented on patch set 36 04/02/25, 07:10
DefaultTcaSchema.php:1047The field is nullable, it should have `null` as default (that means `default` can be omitted), right? -
Garvin Hicking commented on patch set 36 04/02/25, 07:38
DefaultTcaSchema.php:1047ReplyYes, thanks. Follow-up: https://review.typo3.org/c/Packages/TYPO3.CMS/+/88900 -
Lina Wolf commented on patch set 36 04/18/25, 09:25
Please review the entry in the TCA reference: https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-TCA/pull/1253