Review main Abandoned

92755[FEATURE] Provide an option to configure TCA fields as recommended

Bastien Lutz CR -1 V +1 Hard +554 −2 updated 03/18/26, 13:27

Commit message

The TCA as well as the schema api need to be extended with "recommended"
fields. Those are fields that are not firmly required by the corresponding type but should be set.

Review

  • Code review CR -1
    • Benjamin Franzke -1
    • Guido Schmechel +1
    • Tobias Wojtylak +1
  • Verified V +1
    • Guido Schmechel +1
    • Tobias Wojtylak +1
    • core-ci +1 CI

Issues 2

Files 15

Review log 6687

Show 4662 earlier messages
  1. Bastien Lutz uploaded patch set 1 02/09/26, 15:34

  2. core-ci voted on patch set 1 V -1 02/09/26, 15:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95474

  3. Bastien Lutz uploaded patch set 2 V -1 02/09/26, 16:05

  4. core-ci voted on patch set 2 V +1 02/09/26, 16:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95477

  5. Anja Leichsenring commented on patch set 2 02/09/26, 19:37

    Could you please elaborate on the purpose of the field type? Neither the forge issue nor this patch and its commit message provide much guidance, and tests are missing completely. I would probably also tread it as a feature. Integrators will use it, so they should be informed via features.rst and via documentation. What do you think, does this patch deserve a little bit more meat on the bone?
  6. Oli Bartsch commented on patch set 2 02/10/26, 07:29

    ```suggestion Those are fields that are not firmly required by the corresponding type but should be set. ```
  7. Georg Ringer commented on patch set 2 02/10/26, 09:18

    what does "should be set" mean? does that mean it should be filled by the editor? why should the keywords be filled or the subtitle? if we do that, we really need to do it right which means: - only applied for subschema. e.g. page doktype spacer doesn't even have keywords (i guess) but too many information is just missing
  8. Oli Bartsch commented on patch set 2 02/10/26, 10:02

    Reply

    Yes, sure, that's why the new config is on record type level.
  9. Bastien Lutz uploaded patch set 3 V +1 02/10/26, 14:23

  10. Bastien Lutz commented on patch set 3 02/10/26, 14:33

    Reply

    Done
  11. Bastien Lutz uploaded patch set 4 02/10/26, 14:57

  12. core-ci voted on patch set 3 V -1 02/10/26, 14:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95554

  13. core-ci voted on patch set 4 V +1 02/10/26, 15:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95557

  14. Georg Ringer commented on patch set 4 CR -1 02/10/26, 15:57

    I strongly suggest having a page tsconfig option for that as well. reason: having different sites with different features require different fields and then it would be really useful to flag fields on different sites differently

    pages.php:774

    shortcut_mode is IMO wrong. there is always a selected mode because even default is a valid one
  15. Oli Bartsch commented on patch set 4 02/10/26, 16:15

    pages.php:774 Reply

    We need to define it here because otherwise it will not show up in the wizard. The current approach is to have required fields + recommended fields. However this clearly shows that there are huge pitfalls. We additionally need some kind of dependencies because, `shortcut_mode=0` (selected page) with empty `shortcut` is invalid and leads to `Page is configured to be a link but there is actually no valid target defined.`. This is IMO nothing to tackle in this patch but the wizard must handle this. Having such record created would otherwise make the wizard useless.
  16. Oli Bartsch commented on patch set 4 02/10/26, 16:16

    Reply

    Not sure if this is something we need to tackle

    pages.php:774 Reply

    Thought about this again. I think those dependencies should be described in TCA as well, so we should think about it already now.
  17. Oli Bartsch commented on patch set 4 02/10/26, 16:17

    Reply

    in this patch. We decided to create small patches. We could do this as an additional feature on top. But that's no strong opinion. I can live with both options.
  18. Oli Bartsch commented on patch set 4 02/10/26, 16:20

    AbstractFormElement.php:451

    We usually don't do this to create a full type, because this separator is internal knowledge. Let's use the API methods instead. This measn first, fetch the main schema and if the schema supports sub schemas (there is a method tho check) fetch subschema. There are tons of examples in core how to do this.
  19. Oli Bartsch commented on patch set 4 02/10/26, 16:24

    locallang.xlf:133

    We usually don't add such characters to the language label. They are added in rendering.

    FieldTypeInterface.php:41

    We cant do this. This would be a breaking change. For v14 we need to check whether the method exists. But comment this already here with a hint "Activate in v15"

    TcaSchemaFactory.php:240

    I suggest a `array_unique` here.
  20. Daniel Windloff commented on patch set 4 02/11/26, 06:21

    I hope I have understood the idea correctly. What is to be achieved: For TCA types, columns other than required columns and columns such as label should be marked so that they are available as the first (important) selection in wizards. In my opinion, specifying the list of these columns separately for each type could lead to inconsistent configurations again (like search fields in the past). For example, a column could be removed from showitem but not from the recommended section. That is why I think the better approach is to add a property in FieldTypeInterface and as configuration option for each column: 'mycolumn' => [ 'label' => 'Mylabel', 'recommended' => true, 'config' => [ 'type' => 'input' ] ] The approach is then to determine all fields per showitem depending on the type and then check whether each column is a label column or required or recommended. The resulting list will be used. If there are differences (recommended only for one type and not one other) for a column depending on the type, these could be resolved using the existing columnsOverrides for each type. This would ensure that there can be no contradictory settings. From my perspective, a method to get the value of the new configuration option can be added to the FieldTypeInterface without it being breaking, as UserCode can only check the interface but cannot implement it. The FieldTypeFactory does not allow any additional registration, therefore there can not be any custom Fieldtypes in extensions.
  21. Bastien Lutz commented on patch set 4 02/11/26, 08:22

    Reply

    I created an issue for that. We will tackle that in another patch. See: https://forge.typo3.org/issues/108938

    pages.php:774 Reply

    Created an issue for that https://forge.typo3.org/issues/108937
  22. Bastien Lutz commented on patch set 4 02/11/26, 08:49

    Reply

    As discussed in slack recommended will be configured on field level and explicitly set to true if needed via columnOverrides for the specific pagetypes. I'll provide another patchset.
  23. Bastien Lutz uploaded patch set 5 CR -1 V +1 02/11/26, 10:22

  24. core-ci voted on patch set 5 V +1 02/11/26, 10:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95608

  25. Bastien Lutz commented on patch set 5 02/11/26, 12:40

    AbstractFormElement.php:451 Reply

    Done

    locallang.xlf:133 Reply

    Done

    FieldTypeInterface.php:41 Reply

    Done

    TcaSchemaFactory.php:240 Reply

    Done
  26. Benni Mack commented on patch set 5 02/11/26, 13:25

    any reason we have this in the config subarray?
  27. Bastien Lutz commented on patch set 5 02/11/26, 13:38

    Reply

    This just felt the right place. Also that way it is on the same level as required.
  28. Benni Mack commented on patch set 5 02/11/26, 14:20

    Reply

    yeah, Daniel and me tried on the last code sprint to remove the config option altogether (there are POCs flying around). moving this to the main array saves memory right now and more in the future.
  29. Simon Schaufelberger commented on patch set 5 02/11/26, 15:27

    Feature-108916-AddNewTCAOptionRecommendedFields.rst:14

    please try to add line breaks after 70 chars
  30. Anja Leichsenring commented on patch set 6 V +1 02/11/26, 19:28

    Published edit on patch set 5.
  31. Anja Leichsenring commented on patch set 6 CR +1 V +1 02/11/26, 19:34

    this looks nice now, thank you all for the improvements.

    Feature-108916-AddNewTCAOptionRecommendedFields.rst:14 Reply

    Done
  32. core-ci voted on patch set 6 V +1 02/11/26, 19:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95645

  33. Simon Schaufelberger uploaded patch set 7 CR +1 V +1 02/11/26, 22:24

  34. core-ci voted on patch set 7 V +1 02/11/26, 22:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/95659

  35. Garvin Hicking commented on patch set 7 02/11/26, 22:32

    Feature-108916-AddNewTCAOptionRecommendedFields.rst:33

    ```suggestion :caption: EXT:my_extension/Configuration/TCA/Overrides/pages.php $GLOBALS['TCA']['pages']['types'][1]['columnsOverrides']['subtitle']['config']['recommended'] = true; ```
  36. Oli Bartsch commented on patch set 7 02/11/26, 23:13

    Reply

    Yes, let's add this on root level please.

    AbstractFormElement.php:141

    Personally still don't like this additional long word here. I think an icon with proper title (visible via hover and accessible for screenreaders) would be more suitable.

    AbstractFormElement.php:150

    I think we need to adjust this method as well

    pages.php:774 Reply

    I still question whether we should merge this feature if a different approach is ultimately required. It might be better to address the underlying problem instead of introducing this option now and adding another solution later.
  37. Bastien Lutz uploaded patch set 8 V +1 02/19/26, 14:16

  38. Bastien Lutz commented on patch set 8 02/19/26, 14:21

    Reply

    moved to root level

    Feature-108916-AddNewTCAOptionRecommendedFields.rst:33 Reply

    added thanks for the hint.
  39. core-ci voted on patch set 8 V -1 02/19/26, 14:27 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96252

  40. Bastien Lutz uploaded patch set 9 V -1 02/19/26, 14:56

  41. Bastien Lutz uploaded patch set 10 02/19/26, 15:08

  42. core-ci voted on patch set 9 V -1 02/19/26, 15:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96259

  43. core-ci voted on patch set 10 V -1 02/19/26, 15:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96261

  44. Bastien Lutz uploaded patch set 11 02/20/26, 07:29

    Copied Votes: * Verified-1 (copy condition: "**changekind:NO_CHANGE**")
  45. core-ci voted on patch set 11 V +1 02/20/26, 07:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96308

  46. Bastien Lutz uploaded patch set 12 V +1 02/20/26, 08:55

  47. Bastien Lutz commented on patch set 12 02/20/26, 08:55

    AbstractFormElement.php:141 Reply

    Done

    AbstractFormElement.php:150 Reply

    Done

    pages.php:774 Reply

  48. core-ci voted on patch set 12 V -1 02/20/26, 09:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96316

  49. Bastien Lutz uploaded patch set 13 V -1 02/20/26, 09:29

  50. core-ci voted on patch set 13 V -1 02/20/26, 10:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96325

  51. Bastien Lutz uploaded patch set 14 02/20/26, 13:24

    Copied Votes: * Verified-1 (copy condition: "**changekind:NO_CHANGE**")
  52. core-ci voted on patch set 14 V +1 02/20/26, 13:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96349

  53. Andreas Nedbal voted on patch set 14 CR +1 V +1 02/23/26, 12:44

  54. Sven Liebert voted on patch set 14 CR +1 V +1 02/23/26, 17:59

  55. Georg Ringer commented on patch set 14 02/23/26, 19:13

    AbstractFormElement.php:462

    I would move that before the basic getters, but can we have some tests for that?

    locallang.xlf:133

    shouldn't there be a . at the end?

    FieldTypeInterface.php:41

    what is mean with "active"?
  56. Bastien Lutz uploaded patch set 15 CR +1 V +1 02/24/26, 08:58

  57. Bastien Lutz commented on patch set 15 02/24/26, 08:59

    AbstractFormElement.php:462 Reply

    Done

    locallang.xlf:133 Reply

    Done

    FieldTypeInterface.php:41 Reply

    adjusted the comment
  58. core-ci voted on patch set 15 V -1 02/24/26, 09:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96683

  59. Oli Bartsch commented on patch set 15 02/24/26, 09:14

    AbstractFormElement.php:149

    I suggest to add the icon into a badge to visually separate it from the label.

    locallang.xlf:133

    It is recommended to fill out this field

    AbstractFieldType.php:119

    ```suggestion public function isRecommended(): bool { return (bool)($this->configuration['recommended'] ?? false); } ```
  60. Bastien Lutz uploaded patch set 16 V -1 02/24/26, 10:00

  61. Bastien Lutz commented on patch set 16 02/24/26, 10:01

    locallang.xlf:133 Reply

    Done

    AbstractFieldType.php:119 Reply

    Done
  62. core-ci voted on patch set 16 V -1 02/24/26, 10:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96696

  1. Bastien Lutz uploaded patch set 17 V -1 02/24/26, 10:47

  2. Bastien Lutz commented on patch set 17 02/24/26, 10:48

    AbstractFormElement.php:149 Reply

    ass discussed with @benjamin.kott@outlook.com a label in a badge saying "recommended" will be used.
  3. core-ci voted on patch set 17 V -1 02/24/26, 12:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96704

  4. Bastien Lutz rebased onto patch set 18 V -1 02/24/26, 13:12

  5. Georg Ringer commented on patch set 18 02/24/26, 13:24

    should there also be a notification in the toolbar just like if a page title is not filled with the red button? reason: if there are multiple fields flagged with recommended, how does an editor know that there is work todo?

    pages.php:786

    this is wrong. 0 is a valid selection (I know it is bad but nevertheless)
  6. core-ci voted on patch set 18 V +1 02/24/26, 13:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96736

  7. Bastien Lutz commented on patch set 18 02/24/26, 14:45

    Reply

    IMO we sould tackle this in another patch.

    pages.php:786 Reply

    Yes, while 0 is technically a valid value, the field is marked as recommended to nudge the user toward a conscious decision. Recommended does not imply Required. It simply flags the field. Keeping the scope of this patch in mind (https://forge.typo3.org/issues/108915), this flag is necessary to later present the field in an optional step for the user.
  8. Simon Schaufelberger commented on patch set 18 02/24/26, 15:02

    AbstractFormElement.php:441

    Just a naming improvment: I would call it isRecommendedField
  9. Bastien Lutz commented on patch set 18 02/24/26, 15:11

    AbstractFormElement.php:441 Reply

    Thanks for the review but i prefer isFieldRecommended here because it keeps the subject (Field) as the primary identifier.
  10. Andreas Nedbal voted on patch set 18 CR +1 V +1 02/26/26, 15:42

  11. Benjamin Franzke uploaded patch set 19 CR +1 V +1 02/27/26, 12:03

  12. core-ci voted on patch set 19 V +1 02/27/26, 12:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/96969

  13. Guido Schmechel commented on patch set 19 CR +1 V +1 02/28/26, 11:34

    Everything looks good to me so far. The only thing that bothers me is that the badge is a bit inconspicuous. I would emphasise it slightly with css class bg-info. But that's just a matter of taste.
  14. Benjamin Franzke commented on patch set 19 03/02/26, 08:03

    Feature-108916-AddNewTCAOptionRecommendedFields.rst:21

    I like this usecase! I think we should actually also prompt the user in regular FormEngine, if recommended fields have not been filled and allow to fill or ingore. Maybe not upon every save, but at least on initial save? What do you think? It would be fine for me for this to be implemented in a consecutive patch.
  15. Bastien Lutz commented on patch set 19 03/02/26, 08:48

    Feature-108916-AddNewTCAOptionRecommendedFields.rst:21 Reply

    great idea i added a follow up issue for that see: https://forge.typo3.org/issues/109124
  16. Bastien Lutz uploaded patch set 20 CR +1 V +1 03/02/26, 08:58

  17. core-ci voted on patch set 20 V -1 03/02/26, 09:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97090

  18. Bastien Lutz uploaded patch set 21 V -1 03/02/26, 09:49

  19. core-ci voted on patch set 21 V +1 03/02/26, 09:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97093

  20. Benjamin Franzke commented on patch set 21 CR +1 V +1 03/02/26, 10:55

    Feature-108916-AddNewTCAOptionRecommendedFields.rst:21 Reply

    thx!
  21. Tobias Wojtylak voted on patch set 21 CR +1 V +1 03/02/26, 14:30

  22. Guido Schmechel voted on patch set 21 CR +1 V +1 03/02/26, 22:23

  23. Oli Bartsch commented on patch set 21 03/02/26, 22:34

    AbstractFormElement.php:141

    Why do we not use `badge-info` here?

    Feature-108916-AddNewTCAOptionRecommendedFields.rst:34 Unresolved

    based on the above section, I suggest adding one example for usage in `columns` ```suggestion $GLOBALS['TCA']['pages']['columns']['seo_title']['recommended'] = true; ```
  24. Benjamin Franzke commented on patch set 21 V 0 CR -1 03/03/26, 08:08

    on hold

    AbstractFormElement.php:141 Reply Unresolved

    Discussed this with Benji. We'll look at this from a graphic
  25. Bastien Lutz abandoned the change 03/18/26, 13:27