94815[BUGFIX] Respect type-specific Page TSconfig labels
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Markus Klein +1
- Can Adrian Karadag +1
-
Verified V +2 Done
- Benni Mack +2
- Can Adrian Karadag +1
- core-ci +1 CI
Issues 1
Files 2
Review log 1722
-
Can Adrian Karadag uploaded patch set 1 07/17/26, 14:15
-
Benni Mack commented on patch set 1 07/17/26, 14:20
-
Benni Mack voted on patch set 1 CR -1 07/17/26, 14:20
-
core-ci voted on patch set 1 V -1 07/17/26, 14:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/104887
-
Can Adrian Karadag uploaded patch set 2
CR -1V -107/22/26, 11:37 -
Can Adrian Karadag commented on patch set 2 07/22/26, 11:40
BackendUtility.php:1322Reply@benni@typo3.org you're right, i updated the commit and also added a second test which also test for non tt_content table -
Can Adrian Karadag uploaded patch set 3 07/22/26, 11:43
-
core-ci voted on patch set 2 V -1 07/22/26, 11:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105163
-
core-ci voted on patch set 3 V +1 07/22/26, 11:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105164
-
Markus Klein updated the commit message in patch set 4
V +107/22/26, 13:21 -
core-ci voted on patch set 4 V +1 07/22/26, 13:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105183
-
Stefan Bürk commented on patch set 4 07/23/26, 14:25
Thanks for tackling this — the analysis is right and the fix is in the right place: RecordFieldPreviewProcessor already passes uid/pid/row, so the missing piece really is the "types." evaluation in getProcessedValue(). Two things need to change before this can go in: the type-specific TSconfig must be merged *over* the field TSconfig instead of replacing it (this drops altLabels/removeItems for typed records today), and the record type should be resolved via BackendUtility::getTCAtypeValue() instead of reading the row directly. Details inline. I verified the first point locally with an additional functional test: it passes on the parent commit and fails with this patch set.BackendUtility.php:1321getTcaSchema() returns ?TcaSchema, and isset() is false for null, so a table without a schema falls through to $schema->getSubSchemaTypeInformation() and raises an \Error — which catch (\Exception) does not catch. Reachable when $theColConf is passed explicitly (the @internal FlexFormValueFormatter path) for a table without TCA schema. PHPStan runs at level 5 here, so nullable method calls are not reported and CI stays green. Relying on whether $schema happens to be defined by the branch ~70 lines above is fragile in itself.BackendUtility.php:1326Please use BackendUtility::getTCAtypeValue($table, $fullRow, true) — it lives in this very class (line 528) and is exactly what FormEngineUtility::getTCEFORM_TSconfig() uses for this merge. Reading the pointer field off the row misses what that helper handles: * foreign-pointer types ('type' => 'localfield:foreignfield'): getSubSchemaTypeInformation()->getFieldName() returns the *pointer* field, so $fullRow[$fieldName] is a foreign uid and the lookup key is wrong, * array type values (selectCheckBox), * hasSubSchema() validation and the fallback semantics.BackendUtility.php:1334This replaces the field TSconfig instead of overlaying the type section on top of it, which drops everything configured on the field level. TCEFORM.tt_content.my_field { altLabels.option1 = Global label types.textmedia.addItems.option4 = Extra } For a textmedia record with value "option1", main currently resolves "Global label"; with this patch altLabels. is gone and the plain TCA item label wins — a regression on a path that works today, and it also diverges from the edit form, which is the parity this issue asks for. I confirmed this with a functional test on test_table: TCEFORM.test_table.select_field { altLabels.foo = Field level label types.special { addItems.bar = Type specific item } } with a record record_type=special, select_field=foo. On the parent commit it resolves "Field level label"; with patch set 4 it resolves "Default label" (the plain TCA item). Core does this merge in two places, both overlay + strip "types.": * Form/FormDataProvider/PageTsConfigMerged.php:50-58 (ArrayUtility::mergeRecursiveWithOverrule()) * Form/Utility/FormEngineUtility.php:152-155 (array_replace_recursive()) Suggested shape for the whole block, which also resolves the other points below: if (isset($pageTsConfig['TCEFORM.'][$table . '.'][$col . '.']) && is_array($pageTsConfig['TCEFORM.'][$table . '.'][$col . '.'])) { $columnTsConfig = $pageTsConfig['TCEFORM.'][$table . '.'][$col . '.']; $typeSpecificTsConfig = $columnTsConfig['types.'] ?? []; unset($columnTsConfig['types.']); $recordType = self::getTCAtypeValue($table, $fullRow, true); if ($recordType !== null && is_array($typeSpecificTsConfig[$recordType . '.'] ?? null)) { ArrayUtility::mergeRecursiveWithOverrule($columnTsConfig, $typeSpecificTsConfig[$recordType . '.']); } } No try/catch, no schema juggling, and "types." no longer leaks into SchemaLabelResolver. With this shape both of your tests (with the CType adjustment noted further down) and the regression test above are green on sqlite and mariadb.BackendUtility.php:1336An empty catch that swallows the exception (with an unused $e and a blank body) is not something we want here. The explicit guard exists and is used in this class at line 533 and in DataHandler.php:8253: if ($schema->supportsSubSchema()) { ... } With getTCAtypeValue() (see above) the try/catch disappears entirely.BackendUtilityTest.php:943CType "special" is not a declared type in tt_content TCA. The test only passes because the type value is read raw from the row; with proper resolution via getTCAtypeValue(..., skipFallback: true), hasSubSchema('special') is false and the override would not apply — same as in the edit form. I tried the suggested implementation locally: this test then fails with "specialValue" (the raw value), while it passes unchanged when the record uses CType "textmedia". Please use a real CType (e.g. "textmedia"), which also matches the scenario from the issue.BackendUtilityTest.php:1003Nice that this covers a non-tt_content table. What is still missing is the case that guards the merge semantics: a field that has *both* a field-level entry (e.g. altLabels.foo) and a types.<type>. section — the field-level entry must survive for a typed record. That test would have caught the replace-instead-of-merge issue above. A foreign-pointer type table and removeItems inheritance would be worth adding too. -
Stefan Bürk commented on patch set 4 CR -1 07/23/26, 14:28
BackendUtility.php:1321Replyunresolve (resolved was an error)BackendUtility.php:1326Replyunresolve (resolved was an error)BackendUtility.php:1334Replyunresolve (resolved was an error)BackendUtility.php:1336Replyunresolve (resolved was an error)BackendUtilityTest.php:943Replyunresolve (resolved was an error)BackendUtilityTest.php:1003Replyunresolve (resolved was an error) -
Stefan Bürk commented on patch set 4 07/23/26, 14:30
on it ... -
Stefan Bürk uploaded patch set 5
CR -1V +107/23/26, 14:54 -
Stefan Bürk commented on patch set 4 07/23/26, 14:55
BackendUtility.php:1321ReplyDoneBackendUtility.php:1326ReplyDoneBackendUtility.php:1334ReplyDoneBackendUtility.php:1336ReplyDoneBackendUtilityTest.php:943ReplyDoneBackendUtilityTest.php:1003ReplyDone -
Stefan Bürk commented on patch set 5 07/23/26, 14:56
Reply
Done -
core-ci voted on patch set 5 V +1 07/23/26, 15:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/105255
-
Markus Klein voted on patch set 5 CR +1 07/23/26, 15:51
-
Can Adrian Karadag commented on patch set 5 CR +1 V +1 07/24/26, 04:49
thank you for improve my patch, i tested it and everything works as expected -
Benni Mack commented on patch set 5 CR +2 V +2 07/24/26, 07:13
Reply
Done -
Benni Mack merged patch set 6 07/24/26, 07:13
BackendUtility.php:1322