77792[FEATURE] New TCA type "country"
Commit message
Review
-
Code review CR +2 Done
- Garvin Hicking +2
- Anja Leichsenring +1
-
Verified V +2 Done
- Garvin Hicking +2
- Anja Leichsenring +1
- core-ci +1 CI
Issues 2
Files 17
- typo3/sysext/backend/Classes/Form/Element/SelectCountryElement.php8new+268 −0
- typo3/sysext/backend/Classes/Form/FormDataProvider/TcaCountry.php9new+150 −0
- typo3/sysext/backend/Classes/Form/Processor/SelectItemProcessor.php+4 −2
- typo3/sysext/backend/Classes/Form/NodeFactory.php4+1 −0
- typo3/sysext/backend/Classes/Utility/BackendUtility.php8+3 −0
- typo3/sysext/backend/Tests/Functional/Form/Fixtures/TcaCountry/be_users.csvnew+4 −0
- typo3/sysext/backend/Tests/Functional/Form/FormDataProvider/TcaCountryTest.phpnew+159 −0
- typo3/sysext/core/Classes/Database/Schema/DefaultTcaSchema.php+13 −0
- typo3/sysext/core/Classes/DataHandling/DataHandler.php10+13 −0
- typo3/sysext/core/Classes/DataHandling/TableColumnType.php+1 −0
- typo3/sysext/core/Classes/Schema/Field/CountryFieldType.php5new+31 −0
- typo3/sysext/core/Classes/Schema/FieldTypeFactory.php+2 −0
- typo3/sysext/core/Configuration/DefaultConfiguration.php9+7 −0
- typo3/sysext/core/Documentation/Changelog/13.3/Feature-99911-NewTCATypeCountry.rst8new+46 −0
- typo3/sysext/core/Resources/Private/Language/locallang_core.xlf+6 −0
- typo3/sysext/extbase/Tests/Functional/Persistence/Generic/Mapper/ColumnMapFactoryTest.php+1 −0
- typo3/sysext/styleguide/Configuration/TCA/tx_styleguide_elements_select.php+97 −0
Review log 7193
Show 4968 earlier messages
-
Georg Ringer uploaded patch set 1 02/08/23, 22:45
-
Georg Ringer commented on patch set 2 02/08/23, 22:57
Published edit on patch set 1. -
core-ci voted on patch set 1 V -1 02/08/23, 23:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37416
-
core-ci voted on patch set 2 V -1 02/08/23, 23:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37417
-
Georg Ringer uploaded patch set 3
V -102/09/23, 21:18 -
Georg Ringer commented on patch set 3 02/09/23, 21:18
This change is ready for review. -
core-ci voted on patch set 3 V +1 02/09/23, 21:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/37504
-
Benni Mack commented on patch set 3 CR -1 02/10/23, 20:59
ColumnType definition is missing -
Oli Bartsch commented on patch set 3 CR -1 02/10/23, 21:04
TcaCountry.php:28Please have tests for the new data provider.NodeFactory.php:107Shouldn't we better add a dedicated Element for the new TCA type? -
Georg Ringer commented on patch set 3 02/12/23, 11:33
TcaCountry.php:28Replyyes, but maybe let's solve the other question firstNodeFactory.php:107Replythis is a really good question but I went the same way as the language field and it was less duplicate code. the other option I would have liked to use a itemsprocfunc, so users also could use that in a multiselect field - but I am not sure if itemsprocfunc is the way to go as we do more and more tca types. I don't see the need for a dedicated element as we just want to provide data and don't have a different kind of presentation -
Georg Ringer rebased onto patch set 4
CR -1V +103/05/23, 10:10 -
core-ci voted on patch set 4 V +1 03/05/23, 10:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/38483
-
Oliver Hader commented on patch set 4 CR -1 03/06/23, 15:38
NodeFactory.php:107ReplyI think it should be a dedicated new element. Alternatively the common parts of rendering the selector widget could be extracted and reused by the existing `SelectSingleElement` and new `SelectCountryElement`... Currently it looks like (I did not test it), that new TCA type `county` would allow to use settings like `foreign_table` and similar as defined for TCA type `select`. -
Oli Bartsch commented on patch set 4 03/06/23, 15:53
DataHandler.php:1505I think we need a dedicated checkValue method for the new type, especially because it supports a "filter" option. -
Oli Bartsch commented on patch set 4 03/06/23, 15:56
DefaultConfiguration.php:553Shouldn't we add the Provider to other groups, e.g. flexform as well? -
Simon Schaufelberger commented on patch set 4 08/21/23, 20:36
it would be great if this would find its way into the core! -
Guido Schmechel commented on patch set 4 09/15/23, 21:33
Otherwise, from my side, we need the feature. Really fine thing!TcaCountry.php:52Is there a reason why not all getters may be used? I am considering using this provider for patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/66214. In addition: We could probably use match instead of switch here. -
Georg Ringer commented on patch set 4 10/09/23, 16:08
@oliver I would like to finish that but really don't know how to start as this should be more like a itemsprocfunc. the rendering could be anything like selectMultipleSideBySide or selectSingle, so maybe just implement that instead of a new element? -
Simon Schaufelberger commented on patch set 4 12/19/23, 01:22
Reply
ping everyone -
Simon Schaufelberger uploaded patch set 5
CR -1V +112/22/23, 00:14 -
Simon Schaufelberger commented on patch set 5 12/22/23, 00:16
TcaCountry.php:52Replyyes, this is a 1:1 copy of CountrySelectViewHelper. Match is not possible.NodeFactory.php:107ReplyDoneDataHandler.php:1505ReplyDoneDefaultConfiguration.php:553ReplyI don't understand this dependency tree. Where does this need to be added? -
core-ci voted on patch set 5 V -1 12/22/23, 00:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50887
-
Simon Schaufelberger commented on patch set 5 12/22/23, 00:20
TcaCountry.php:52ReplyDoneTcaCountry.php:92I'm not sure about this one. If prioritizedCountries is set, the countries are on top but it looks messy as there is no clear separator when the remaining continue. The only problem is that this entry is also selectable but should be "disabled" but the core doesn't support that atm. -
Simon Schaufelberger uploaded patch set 6
V -112/22/23, 00:30 -
core-ci voted on patch set 6 V +1 12/22/23, 00:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50888
-
Benni Mack wrote 01/30/24, 14:28
Removed reviewer Benni Mack. -
Simon Schaufelberger rebased onto patch set 7
V +103/29/24, 10:07 -
core-ci voted on patch set 7 V +1 03/29/24, 10:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/55060
-
Simon Schaufelberger commented on patch set 7 05/07/24, 08:38
TcaCountry.php:92Replyping @georg.ringer@gmail.com what do you think about that? -
Georg Ringer voted on patch set 7 CR +1 V +1 06/17/24, 19:49
-
Alexander Vogt voted on patch set 7 V +1 06/18/24, 07:31
-
Simon Schaufelberger rebased onto patch set 8
CR +1V +107/11/24, 11:56 -
core-ci voted on patch set 8 V +1 07/11/24, 12:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61379
-
Fabien Udriot voted on patch set 8 CR +1 07/11/24, 12:49
-
Guido Schmechel uploaded patch set 9
CR +1V +107/15/24, 22:16 -
Guido Schmechel commented on patch set 9 07/15/24, 22:20
(Just moved the documentation) To be clarified: Should the new TCA schema generator also be adapt in this patch? -
core-ci voted on patch set 9 V +1 07/15/24, 22:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/61598
-
Georg Ringer uploaded patch set 10
V +107/27/24, 18:12 -
core-ci voted on patch set 10 V -1 07/27/24, 18:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62314
-
Georg Ringer uploaded patch set 11
V -107/27/24, 18:39 -
core-ci voted on patch set 11 V -1 07/27/24, 18:47 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62317
-
Guido Schmechel uploaded patch set 12
V -107/28/24, 10:34 -
Guido Schmechel uploaded patch set 13 07/28/24, 10:36
-
core-ci voted on patch set 12 V -1 07/28/24, 10:40 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62346
-
core-ci voted on patch set 13 V -1 07/28/24, 10:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62347
-
Georg Ringer uploaded patch set 14
V -107/29/24, 19:06 -
core-ci voted on patch set 14 V +1 07/29/24, 19:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62398
-
Anja Leichsenring commented on patch set 14 CR +1 V +1 08/01/24, 11:50
I like! -
Benni Mack commented on patch set 14 08/06/24, 15:45
we also need a Schema FieldType now -
Anja Leichsenring commented on patch set 14 V -1 08/07/24, 16:55
I add the schema -
Anja Leichsenring uploaded patch set 15
CR +1V +108/07/24, 17:11 -
Anja Leichsenring voted on patch set 15 CR +1 V +1 08/07/24, 17:14
-
core-ci voted on patch set 15 V -1 08/07/24, 17:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63008
-
Anja Leichsenring uploaded patch set 16
CR +1V +108/07/24, 17:40 -
core-ci voted on patch set 16 V -1 08/07/24, 17:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63010
-
Anja Leichsenring uploaded patch set 17
V -108/07/24, 17:54 -
core-ci voted on patch set 17 V +1 08/07/24, 17:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63011
-
Georg Ringer commented on patch set 17 CR -1 08/08/24, 06:04
CountryFieldType.php:5now there are 2 headers -
Guido Schmechel uploaded patch set 18
CR -1V +108/17/24, 17:00 -
Guido Schmechel commented on patch set 18 08/17/24, 17:00
CountryFieldType.php:5ReplyDone -
core-ci voted on patch set 18 V -1 08/17/24, 17:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63662
-
Guido Schmechel rebased onto patch set 19
V -108/17/24, 17:23 -
core-ci voted on patch set 19 V +1 08/17/24, 17:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63663
-
Simon Schaufelberger commented on patch set 19 09/07/24, 20:54
I hope this can make it into v13 -
Guido Schmechel voted on patch set 19 CR +1 V +1 09/08/24, 09:05
-
Benni Mack commented on patch set 19 09/12/24, 07:37
As mentioned, I think we need some tests... -
Christian Kuhn uploaded patch set 20
CR +1V +109/16/24, 23:01 -
Christian Kuhn commented on patch set 19 09/16/24, 23:01
added basic coverageTcaCountry.php:28ReplyDoneTcaCountry.php:92Replyi don't get it: the 'prioritized country' thing looks good to me in country_2 of styleguide select: it is the same optgroup solution we have a other places, too.DefaultConfiguration.php:553Replynot 100% sure which other groups this provider should be added to at the moment. i guess we need to test if country already works within flex form first (and probably have a styleguide example). i'd say its ok to have it for tcaDatabaseRecord only for now and eventually add as task to other groups if they work, too.
-
Christian Kuhn uploaded patch set 21 09/16/24, 23:12
-
core-ci voted on patch set 20 V -1 09/16/24, 23:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65930
-
core-ci voted on patch set 21 V +1 09/16/24, 23:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65931
-
Christian Kuhn voted on patch set 21 CR +1 V +1 09/16/24, 23:26
-
Garvin Hicking uploaded patch set 22
CR +1V +109/17/24, 06:33Typos and flex stub -
Garvin Hicking commented on patch set 22 CR +1 V +1 09/17/24, 06:35
Looking good; some typos removed and added a flexform todo/note, IMO not-blocking.DataHandler.php:2439This comment feel off/unrelated?! Why are files relevant for this tca type?DefaultConfiguration.php:553ReplyIn fact, TCA country type does not work in flexform yet, the 'items' array is not populated. I took the liberty to add a stub for it in EXT:styleguide for the future. IMO this should be non blocking and we can add that in as a task in stabilization phase. -
core-ci voted on patch set 22 V +1 09/17/24, 06:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/65946
-
Anja Leichsenring voted on patch set 22 CR +1 V +1 09/17/24, 07:03
-
Garvin Hicking voted on patch set 22 CR +2 V +2 09/17/24, 07:04
-
Garvin Hicking merged patch set 23 09/17/24, 07:04
-
Garvin Hicking commented on patch set 23 09/17/24, 07:05
flexform integration and inline comment will be resolved in follow-upDataHandler.php:2439ReplyAcknowledgedDefaultConfiguration.php:553ReplyAcknowledged -
Oli Bartsch commented on patch set 23 09/17/24, 07:08
AFAICS the type is not handled for record transformation, right? -
Oli Bartsch commented on patch set 23 09/17/24, 07:32
Sorry, but I have a Post -1 here..SelectCountryElement.php:95The whole inline stuff here seems to be superfluous since the field does not do any relations, right?SelectCountryElement.php:262I'm in favour of using a dedicated JS component for this new type. This will otherwise lead t the fact we always have to consider both types when doing changes.CountryFieldType.php:27Abstract already defines this method.DefaultConfiguration.php:568Is not adding the provider to the "flexFormSegment" group intentionally?Feature-99911-NewTCATypeCountry.rst:18I'm missing the list of available properties as done for the other types we introduced recentlyFeature-99911-NewTCATypeCountry.rst:19Is it correct that the new type is not considered in FormEngineUtility::allowOverrideMatrix()?Feature-99911-NewTCATypeCountry.rst:44I'm missing the "Impact" section here. -
Oli Bartsch commented on patch set 23 09/17/24, 08:30
SelectCountryElement.php:138UnresolvedHow can this be an array in the first place?BackendUtility.php:1830We are missing an entry in the RecordTitleProviderBackendUtility.php:1830UnresolvedWe are missing entries in DatabaseIntegrityController::getProcessedValueExtra() and DatabaseIntegrityController::init()BackendUtility.php:1831Processed value should be the country name, right?DataHandler.php:2434UnresolvedThis method should get some tests.DataHandler.php:2436Does this really apply to the country type? I assume since this is a single select, it's just one country code.DataHandler.php:2439This comment seems to be not related to the typeDataHandler.php:2440UnresolvedThis does not have any effect because no userFunc is defined. I think we have to use the CountryFilter here, like done in the data provider.DefaultConfiguration.php:1044Should we support the new type for site configurations as well?Feature-99911-NewTCATypeCountry.rst:33UnresolvedAs mentioned, this is not respected by DataHandler -
Christian Kuhn commented on patch set 23 09/17/24, 08:57
Reply
this change was pending for 1.5 years with 10 persons regularly working on it, including you, leaving this obviously missing feature in limbo for the last few weeks with "only tests missing". none of your comments looks structurally critical to me, but like a bunch of details. do you agree?Reply
i don' even understand what you mean with this.SelectCountryElement.php:95Reply.SelectCountryElement.php:262Replyit works and is what we always did. having a component here is your personal taste.BackendUtility.php:1830Reply.CountryFieldType.php:27Replyno-brainer follow-up.DefaultConfiguration.php:568Replyplease read up on previous comments.DefaultConfiguration.php:1044Replyno.Feature-99911-NewTCATypeCountry.rst:18Reply.Feature-99911-NewTCATypeCountry.rst:19Replyyes. default is: nothing is allowed to override. -
Garvin Hicking commented on patch set 23 09/17/24, 09:32
Reply
Let's resolve this together, I'll do my best to help out and hope we can find a middleground to go from. I've created the follow-up https://review.typo3.org/c/Packages/TYPO3.CMS/+/86134 for now and will try to go through the issues. I do think Oli wants this as bad as we do, and I hope we can achieve a level of quality and correctness that can be part of the final 13.4 LTS release. -
Garvin Hicking commented on patch set 23 09/17/24, 10:18
SelectCountryElement.php:95ReplyAddressed in follow-upBackendUtility.php:1830ReplyCould you elaborate? You mean RecordPageTitleProvider?BackendUtility.php:1831ReplyI'd say we want the language code here (like "DE") and not something like "Germany". To allow using the Country PHP API to further operate on the object (i.e. extbase type conversion?)DataHandler.php:2436Reply UnresolvedI think due to the new TCA type stemming from the TCA SelectSingle one, it just ensures that the country code (DE, EN, ...) is part of the TCA value definition, so probably straight-forward and part of the TCA select type tests (due to relying on `checkValue_group_select_explodeSelectGroupValue` via `checkValueForGroupFolderSelect` which however seems to have no test coverage yet either?)DataHandler.php:2439ReplyAddressed in follow-upCountryFieldType.php:27ReplyAddressed in follow-upFeature-99911-NewTCATypeCountry.rst:18ReplyAddressed in follow-upFeature-99911-NewTCATypeCountry.rst:44ReplyDone -
Oli Bartsch commented on patch set 23 09/17/24, 10:37
SelectCountryElement.php:262ReplyThats not true. We don't reuse element components in FormEngine elements. What we reuse are additional components e.g. value-picker. But each FormEngine element has it's own JS component. -
Garvin Hicking wrote 09/17/24, 10:38
Created a revert of this change as Ib532b096417d18d89a5695136a28ea594caa518c -
Oli Bartsch commented on patch set 23 09/17/24, 10:38
BackendUtility.php:1830Reply UnresolvedSorry, I mean `TcaRecordTitle` -
Oli Bartsch commented on patch set 23 09/17/24, 10:41
Reply
I unfortunately do not agree with this patch having "just details" to be fixed. I actually wished that we could just do follow ups. However, especially the DataHandler part as well as missing flexform integration and missing field transformation make this incomplete and IMO we should not ship it this way in todays release. -
Oli Bartsch commented on patch set 23 09/17/24, 10:48
Reply Unresolved
The type is not considered in RecordFieldTransformer->transformField(), which should transform the raw database value into a Country object. -
Oli Bartsch commented on patch set 23 09/17/24, 10:56
BackendUtility.php:1831Reply UnresolvedWhy do you think of using just the language code? - Since the method is for transforming the database value into a human readable value, we should IMO be in line with the label, used in FormEngine (when opening the record). Therefore, we should respect the defined "labelField" here as well. -
Garvin Hicking commented on patch set 23 09/18/24, 12:06
Reply
New attempt will be made here: https://review.typo3.org/c/Packages/TYPO3.CMS/+/86177SelectCountryElement.php:262ReplyAdressed in follow-up