Review main Merged

77792[FEATURE] New TCA type "country"

Georg Ringer CR +2 V +2 Hard +806 −2 updated 09/18/24, 12:06

Commit message

The TCA type "country" utilizes the country API provided
with #99618 to give integrators a simple way to implement
a country selection.

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

Review log 7193

Show 4968 earlier messages
  1. Georg Ringer uploaded patch set 1 02/08/23, 22:45

  2. Georg Ringer commented on patch set 2 02/08/23, 22:57

    Published edit on patch set 1.
  3. 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

  4. 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

  5. Georg Ringer uploaded patch set 3 V -1 02/09/23, 21:18

  6. Georg Ringer commented on patch set 3 02/09/23, 21:18

    This change is ready for review.
  7. 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

  8. Benni Mack commented on patch set 3 CR -1 02/10/23, 20:59

    ColumnType definition is missing
  9. Oli Bartsch commented on patch set 3 CR -1 02/10/23, 21:04

    TcaCountry.php:28

    Please have tests for the new data provider.

    NodeFactory.php:107

    Shouldn't we better add a dedicated Element for the new TCA type?
  10. Georg Ringer commented on patch set 3 02/12/23, 11:33

    TcaCountry.php:28 Reply

    yes, but maybe let's solve the other question first

    NodeFactory.php:107 Reply

    this 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
  11. Georg Ringer rebased onto patch set 4 CR -1 V +1 03/05/23, 10:10

  12. 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

  13. Oliver Hader commented on patch set 4 CR -1 03/06/23, 15:38

    NodeFactory.php:107 Reply

    I 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`.
  14. Oli Bartsch commented on patch set 4 03/06/23, 15:53

    DataHandler.php:1505

    I think we need a dedicated checkValue method for the new type, especially because it supports a "filter" option.
  15. Oli Bartsch commented on patch set 4 03/06/23, 15:56

    DefaultConfiguration.php:553

    Shouldn't we add the Provider to other groups, e.g. flexform as well?
  16. 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!
  17. 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:52

    Is 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.
  18. 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?
  19. Simon Schaufelberger commented on patch set 4 12/19/23, 01:22

    Reply

    ping everyone
  20. Simon Schaufelberger uploaded patch set 5 CR -1 V +1 12/22/23, 00:14

  21. Simon Schaufelberger commented on patch set 5 12/22/23, 00:16

    TcaCountry.php:52 Reply

    yes, this is a 1:1 copy of CountrySelectViewHelper. Match is not possible.

    NodeFactory.php:107 Reply

    Done

    DataHandler.php:1505 Reply

    Done

    DefaultConfiguration.php:553 Reply

    I don't understand this dependency tree. Where does this need to be added?
  22. 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

  23. Simon Schaufelberger commented on patch set 5 12/22/23, 00:20

    TcaCountry.php:52 Reply

    Done

    TcaCountry.php:92

    I'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.
  24. Simon Schaufelberger uploaded patch set 6 V -1 12/22/23, 00:30

  25. 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

  26. Benni Mack wrote 01/30/24, 14:28

    Removed reviewer Benni Mack.
  27. Simon Schaufelberger rebased onto patch set 7 V +1 03/29/24, 10:07

  28. 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

  29. Simon Schaufelberger commented on patch set 7 05/07/24, 08:38

    TcaCountry.php:92 Reply

    ping @georg.ringer@gmail.com what do you think about that?
  30. Georg Ringer voted on patch set 7 CR +1 V +1 06/17/24, 19:49

  31. Alexander Vogt voted on patch set 7 V +1 06/18/24, 07:31

  32. Simon Schaufelberger rebased onto patch set 8 CR +1 V +1 07/11/24, 11:56

  33. 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

  34. Fabien Udriot voted on patch set 8 CR +1 07/11/24, 12:49

  35. Guido Schmechel uploaded patch set 9 CR +1 V +1 07/15/24, 22:16

  36. 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?
  37. 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

  38. Georg Ringer uploaded patch set 10 V +1 07/27/24, 18:12

  39. 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

  40. Georg Ringer uploaded patch set 11 V -1 07/27/24, 18:39

  41. 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

  42. Guido Schmechel uploaded patch set 12 V -1 07/28/24, 10:34

  43. Guido Schmechel uploaded patch set 13 07/28/24, 10:36

  44. 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

  45. 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

  46. Georg Ringer uploaded patch set 14 V -1 07/29/24, 19:06

  47. 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

  48. Anja Leichsenring commented on patch set 14 CR +1 V +1 08/01/24, 11:50

    I like!
  49. Benni Mack commented on patch set 14 08/06/24, 15:45

    we also need a Schema FieldType now
  50. Anja Leichsenring commented on patch set 14 V -1 08/07/24, 16:55

    I add the schema
  51. Anja Leichsenring uploaded patch set 15 CR +1 V +1 08/07/24, 17:11

  52. Anja Leichsenring voted on patch set 15 CR +1 V +1 08/07/24, 17:14

  53. 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

  54. Anja Leichsenring uploaded patch set 16 CR +1 V +1 08/07/24, 17:40

  55. 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

  56. Anja Leichsenring uploaded patch set 17 V -1 08/07/24, 17:54

  57. 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

  58. Georg Ringer commented on patch set 17 CR -1 08/08/24, 06:04

    CountryFieldType.php:5

    now there are 2 headers
  59. Guido Schmechel uploaded patch set 18 CR -1 V +1 08/17/24, 17:00

  60. Guido Schmechel commented on patch set 18 08/17/24, 17:00

    CountryFieldType.php:5 Reply

    Done
  61. 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

  62. Guido Schmechel rebased onto patch set 19 V -1 08/17/24, 17:23

  63. 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

  64. Simon Schaufelberger commented on patch set 19 09/07/24, 20:54

    I hope this can make it into v13
  65. Guido Schmechel voted on patch set 19 CR +1 V +1 09/08/24, 09:05

  66. Benni Mack commented on patch set 19 09/12/24, 07:37

    As mentioned, I think we need some tests...
  67. Christian Kuhn uploaded patch set 20 CR +1 V +1 09/16/24, 23:01

  68. Christian Kuhn commented on patch set 19 09/16/24, 23:01

    added basic coverage

    TcaCountry.php:28 Reply

    Done

    TcaCountry.php:92 Reply

    i 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:553 Reply

    not 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.
  1. Christian Kuhn commented on patch set 20 09/16/24, 23:01

    Reply

    Acknowledged

    Reply

    Acknowledged
  2. Christian Kuhn uploaded patch set 21 09/16/24, 23:12

  3. 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

  4. 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

  5. Christian Kuhn voted on patch set 21 CR +1 V +1 09/16/24, 23:26

  6. Garvin Hicking uploaded patch set 22 CR +1 V +1 09/17/24, 06:33

    Typos and flex stub
  7. 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:2439

    This comment feel off/unrelated?! Why are files relevant for this tca type?

    DefaultConfiguration.php:553 Reply

    In 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.
  8. 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

  9. Anja Leichsenring voted on patch set 22 CR +1 V +1 09/17/24, 07:03

  10. Garvin Hicking voted on patch set 22 CR +2 V +2 09/17/24, 07:04

  11. Garvin Hicking merged patch set 23 09/17/24, 07:04

  12. Garvin Hicking commented on patch set 23 09/17/24, 07:05

    flexform integration and inline comment will be resolved in follow-up

    DataHandler.php:2439 Reply

    Acknowledged

    DefaultConfiguration.php:553 Reply

    Acknowledged
  13. Oli Bartsch commented on patch set 23 09/17/24, 07:08

    AFAICS the type is not handled for record transformation, right?
  14. Oli Bartsch commented on patch set 23 09/17/24, 07:32

    Sorry, but I have a Post -1 here..

    SelectCountryElement.php:95

    The whole inline stuff here seems to be superfluous since the field does not do any relations, right?

    SelectCountryElement.php:262

    I'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:27

    Abstract already defines this method.

    DefaultConfiguration.php:568

    Is not adding the provider to the "flexFormSegment" group intentionally?

    Feature-99911-NewTCATypeCountry.rst:18

    I'm missing the list of available properties as done for the other types we introduced recently

    Feature-99911-NewTCATypeCountry.rst:19

    Is it correct that the new type is not considered in FormEngineUtility::allowOverrideMatrix()?

    Feature-99911-NewTCATypeCountry.rst:44

    I'm missing the "Impact" section here.
  15. Oli Bartsch commented on patch set 23 09/17/24, 08:30

    SelectCountryElement.php:138 Unresolved

    How can this be an array in the first place?

    BackendUtility.php:1830

    We are missing an entry in the RecordTitleProvider

    BackendUtility.php:1830 Unresolved

    We are missing entries in DatabaseIntegrityController::getProcessedValueExtra() and DatabaseIntegrityController::init()

    BackendUtility.php:1831

    Processed value should be the country name, right?

    DataHandler.php:2434 Unresolved

    This method should get some tests.

    DataHandler.php:2436

    Does this really apply to the country type? I assume since this is a single select, it's just one country code.

    DataHandler.php:2439

    This comment seems to be not related to the type

    DataHandler.php:2440 Unresolved

    This 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:1044

    Should we support the new type for site configurations as well?

    Feature-99911-NewTCATypeCountry.rst:33 Unresolved

    As mentioned, this is not respected by DataHandler
  16. 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:95 Reply

    .

    SelectCountryElement.php:262 Reply

    it works and is what we always did. having a component here is your personal taste.

    BackendUtility.php:1830 Reply

    .

    CountryFieldType.php:27 Reply

    no-brainer follow-up.

    DefaultConfiguration.php:568 Reply

    please read up on previous comments.

    DefaultConfiguration.php:1044 Reply

    no.

    Feature-99911-NewTCATypeCountry.rst:18 Reply

    .

    Feature-99911-NewTCATypeCountry.rst:19 Reply

    yes. default is: nothing is allowed to override.
  17. 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.
  18. Garvin Hicking commented on patch set 23 09/17/24, 10:18

    SelectCountryElement.php:95 Reply

    Addressed in follow-up

    BackendUtility.php:1830 Reply

    Could you elaborate? You mean RecordPageTitleProvider?

    BackendUtility.php:1831 Reply

    I'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:2436 Reply Unresolved

    I 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:2439 Reply

    Addressed in follow-up

    CountryFieldType.php:27 Reply

    Addressed in follow-up

    Feature-99911-NewTCATypeCountry.rst:18 Reply

    Addressed in follow-up

    Feature-99911-NewTCATypeCountry.rst:44 Reply

    Done
  19. Oli Bartsch commented on patch set 23 09/17/24, 10:37

    SelectCountryElement.php:262 Reply

    Thats 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.
  20. Garvin Hicking wrote 09/17/24, 10:38

    Created a revert of this change as Ib532b096417d18d89a5695136a28ea594caa518c
  21. Oli Bartsch commented on patch set 23 09/17/24, 10:38

    BackendUtility.php:1830 Reply Unresolved

    Sorry, I mean `TcaRecordTitle`
  22. 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.
  23. 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.
  24. Oli Bartsch commented on patch set 23 09/17/24, 10:56

    BackendUtility.php:1831 Reply Unresolved

    Why 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.
  25. Garvin Hicking commented on patch set 23 09/18/24, 12:06

    Reply

    SelectCountryElement.php:262 Reply

    Adressed in follow-up