92755[FEATURE] Provide an option to configure TCA fields as recommended
Commit message
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
- typo3/sysext/backend/Classes/Form/Element/AbstractFormElement.php14+36 −0
- typo3/sysext/backend/Classes/Form/Element/UserSysFileStorageIsPublicElement.php+0 −2
- typo3/sysext/backend/Resources/Private/Language/locallang.xlf6+6 −0
- typo3/sysext/backend/Tests/Functional/Form/Element/AbstractFormElementTest.phpnew+178 −0
- typo3/sysext/backend/Tests/Functional/Form/Element/MfaInfoElementTest.php+2 −0
- typo3/sysext/backend/Tests/Unit/Form/Element/AbstractFormElementTest.php+161 −0
- typo3/sysext/backend/Tests/Unit/Form/Element/DatetimeElementTest.php+7 −0
- typo3/sysext/backend/Tests/Unit/Form/Element/JsonElementTest.php+5 −0
- typo3/sysext/backend/Tests/Unit/Form/Element/UuidElementTest.php+5 −0
- typo3/sysext/core/Classes/Schema/Field/AbstractFieldType.php2+5 −0
- typo3/sysext/core/Classes/Schema/Field/FieldTypeInterface.php4+1 −0
- typo3/sysext/core/Configuration/TCA/pages.php8+24 −0
- typo3/sysext/core/Documentation/Changelog/14.2/Feature-108916-AddNewTCAOptionRecommendedFields.rst8new+44 −0
- typo3/sysext/core/Tests/Unit/Schema/TcaSchemaFactoryTest.php+71 −0
- typo3/sysext/seo/Configuration/TCA/Overrides/pages.php+9 −0
Review log 6687
Show 4662 earlier messages
-
Bastien Lutz uploaded patch set 1 02/09/26, 15:34
-
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
-
Bastien Lutz uploaded patch set 2
V -102/09/26, 16:05 -
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
-
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? -
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. ``` -
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 -
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. -
Bastien Lutz uploaded patch set 3
V +102/10/26, 14:23 -
Bastien Lutz commented on patch set 3 02/10/26, 14:33
Reply
Done -
Bastien Lutz uploaded patch set 4 02/10/26, 14:57
-
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
-
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
-
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 differentlypages.php:774shortcut_mode is IMO wrong. there is always a selected mode because even default is a valid one -
Oli Bartsch commented on patch set 4 02/10/26, 16:15
pages.php:774ReplyWe 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. -
Oli Bartsch commented on patch set 4 02/10/26, 16:16
Reply
Not sure if this is something we need to tacklepages.php:774ReplyThought about this again. I think those dependencies should be described in TCA as well, so we should think about it already now. -
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. -
Oli Bartsch commented on patch set 4 02/10/26, 16:20
AbstractFormElement.php:451We 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. -
Oli Bartsch commented on patch set 4 02/10/26, 16:24
locallang.xlf:133We usually don't add such characters to the language label. They are added in rendering.FieldTypeInterface.php:41We 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:240I suggest a `array_unique` here. -
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. -
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/108938pages.php:774ReplyCreated an issue for that https://forge.typo3.org/issues/108937 -
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. -
Bastien Lutz uploaded patch set 5
CR -1V +102/11/26, 10:22 -
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
-
Bastien Lutz commented on patch set 5 02/11/26, 12:40
AbstractFormElement.php:451ReplyDonelocallang.xlf:133ReplyDoneFieldTypeInterface.php:41ReplyDoneTcaSchemaFactory.php:240ReplyDone -
Benni Mack commented on patch set 5 02/11/26, 13:25
any reason we have this in the config subarray? -
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. -
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. -
Simon Schaufelberger commented on patch set 5 02/11/26, 15:27
Feature-108916-AddNewTCAOptionRecommendedFields.rst:14please try to add line breaks after 70 chars -
Anja Leichsenring commented on patch set 6
V +102/11/26, 19:28Published edit on patch set 5. -
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:14ReplyDone -
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
-
Simon Schaufelberger uploaded patch set 7
CR +1V +102/11/26, 22:24 -
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
-
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; ``` -
Oli Bartsch commented on patch set 7 02/11/26, 23:13
Reply
Yes, let's add this on root level please.AbstractFormElement.php:141Personally 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:150I think we need to adjust this method as wellpages.php:774ReplyI 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. -
Bastien Lutz uploaded patch set 8
V +102/19/26, 14:16 -
Bastien Lutz commented on patch set 8 02/19/26, 14:21
Reply
moved to root levelFeature-108916-AddNewTCAOptionRecommendedFields.rst:33Replyadded thanks for the hint. -
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
-
Bastien Lutz uploaded patch set 9
V -102/19/26, 14:56 -
Bastien Lutz uploaded patch set 10 02/19/26, 15:08
-
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
-
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
-
Bastien Lutz uploaded patch set 11 02/20/26, 07:29
Copied Votes: * Verified-1 (copy condition: "**changekind:NO_CHANGE**") -
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
-
Bastien Lutz uploaded patch set 12
V +102/20/26, 08:55 -
Bastien Lutz commented on patch set 12 02/20/26, 08:55
AbstractFormElement.php:141ReplyDoneAbstractFormElement.php:150ReplyDonepages.php:774Replywe will tackle this in https://forge.typo3.org/issues/108937 -
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
-
Bastien Lutz uploaded patch set 13
V -102/20/26, 09:29 -
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
-
Bastien Lutz uploaded patch set 14 02/20/26, 13:24
Copied Votes: * Verified-1 (copy condition: "**changekind:NO_CHANGE**") -
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
-
Andreas Nedbal voted on patch set 14 CR +1 V +1 02/23/26, 12:44
-
Sven Liebert voted on patch set 14 CR +1 V +1 02/23/26, 17:59
-
Georg Ringer commented on patch set 14 02/23/26, 19:13
AbstractFormElement.php:462I would move that before the basic getters, but can we have some tests for that?locallang.xlf:133shouldn't there be a . at the end?FieldTypeInterface.php:41what is mean with "active"? -
Bastien Lutz uploaded patch set 15
CR +1V +102/24/26, 08:58 -
Bastien Lutz commented on patch set 15 02/24/26, 08:59
AbstractFormElement.php:462ReplyDonelocallang.xlf:133ReplyDoneFieldTypeInterface.php:41Replyadjusted the comment -
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
-
Oli Bartsch commented on patch set 15 02/24/26, 09:14
AbstractFormElement.php:149I suggest to add the icon into a badge to visually separate it from the label.locallang.xlf:133It is recommended to fill out this fieldAbstractFieldType.php:119```suggestion public function isRecommended(): bool { return (bool)($this->configuration['recommended'] ?? false); } ``` -
Bastien Lutz uploaded patch set 16
V -102/24/26, 10:00 -
Bastien Lutz commented on patch set 16 02/24/26, 10:01
locallang.xlf:133ReplyDoneAbstractFieldType.php:119ReplyDone -
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
-
Bastien Lutz uploaded patch set 17
V -102/24/26, 10:47 -
Bastien Lutz commented on patch set 17 02/24/26, 10:48
AbstractFormElement.php:149Replyass discussed with @benjamin.kott@outlook.com a label in a badge saying "recommended" will be used. -
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
-
Bastien Lutz rebased onto patch set 18
V -102/24/26, 13:12 -
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:786this is wrong. 0 is a valid selection (I know it is bad but nevertheless) -
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
-
Bastien Lutz commented on patch set 18 02/24/26, 14:45
Reply
IMO we sould tackle this in another patch.pages.php:786ReplyYes, 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. -
Simon Schaufelberger commented on patch set 18 02/24/26, 15:02
AbstractFormElement.php:441Just a naming improvment: I would call it isRecommendedField -
Bastien Lutz commented on patch set 18 02/24/26, 15:11
AbstractFormElement.php:441ReplyThanks for the review but i prefer isFieldRecommended here because it keeps the subject (Field) as the primary identifier. -
Andreas Nedbal voted on patch set 18 CR +1 V +1 02/26/26, 15:42
-
Benjamin Franzke uploaded patch set 19
CR +1V +102/27/26, 12:03 -
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
-
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. -
Benjamin Franzke commented on patch set 19 03/02/26, 08:03
Feature-108916-AddNewTCAOptionRecommendedFields.rst:21I 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. -
Bastien Lutz commented on patch set 19 03/02/26, 08:48
Feature-108916-AddNewTCAOptionRecommendedFields.rst:21Replygreat idea i added a follow up issue for that see: https://forge.typo3.org/issues/109124 -
Bastien Lutz uploaded patch set 20
CR +1V +103/02/26, 08:58 -
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
-
Bastien Lutz uploaded patch set 21
V -103/02/26, 09:49 -
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
-
Benjamin Franzke commented on patch set 21 CR +1 V +1 03/02/26, 10:55
Feature-108916-AddNewTCAOptionRecommendedFields.rst:21Replythx! -
Tobias Wojtylak voted on patch set 21 CR +1 V +1 03/02/26, 14:30
-
Guido Schmechel voted on patch set 21 CR +1 V +1 03/02/26, 22:23
-
Oli Bartsch commented on patch set 21 03/02/26, 22:34
AbstractFormElement.php:141Why do we not use `badge-info` here?Feature-108916-AddNewTCAOptionRecommendedFields.rst:34Unresolvedbased on the above section, I suggest adding one example for usage in `columns` ```suggestion $GLOBALS['TCA']['pages']['columns']['seo_title']['recommended'] = true; ``` -
Benjamin Franzke commented on patch set 21 V 0 CR -1 03/03/26, 08:08
on holdAbstractFormElement.php:141Reply UnresolvedDiscussed this with Benji. We'll look at this from a graphic -
Bastien Lutz abandoned the change 03/18/26, 13:27