#109257 FileList throws TypeError when TCA field has no label (LanguageService::translateLabel() receives null)
Description
Opening the file list module in the TYPO3 backend throws the following exception:
TypeError: TYPO3\CMS\Core\Localization\LanguageService::translateLabel():
Argument #2 ($fallback) must be of type string, null given,
called in vendor/typo3/cms-filelist/Classes/FileList.php on line 1716
Root cause:
In FileList::getFieldLabel() (line 1712–1716), the $label variable is retrieved via $schema->getField($field)->getLabel(), which can return null for TCA fields that have no label defined (e.g. internal fields like fileinfo, l10n_diffsource, crdate, foreign_table_parent_uid).
This null is then passed as the $fallback argument to LanguageService::translateLabel(), which since TYPO3 14 enforces a strict string type declaration on that parameter.
Affected code (FileList.php, line 1712–1716):
php$schema = $this->tcaSchemaFactory->has($concreteTableName) ? $this->tcaSchemaFactory->get($concreteTableName) : null;
$label = $schema?->hasField($field) ? $schema->getField($field)->getLabel() : null;
$tsConfig = BackendUtility::getPagesTSconfig(0);
$label = $lang->translateLabel(
$tsConfig[‘TCEFORM.’][$concreteTableName . ‘.’][$field . ‘.’][‘label.’] ?? [],
$tsConfig[‘TCEFORM.’][$concreteTableName . ‘.’][$field . ‘.’][‘label’] ?? $label // $label can be null here
);
Proposed fix:
Change line 1713 to fall back to an empty string instead of null:
php$label = $schema?->hasField($field) ? ($schema->getField($field)->getLabel() ?? ‘’) : ‘’;
Steps to reproduce:
Install TYPO3 14.x with any extension that adds TCA columns without a label key (or with extensions like ext:news, ext:ke_search, ext:impexp)
Open the backend file list module (Filelist > any folder)
TypeError is thrown immediately
Expected behavior:
File list renders without error; fields without a label are shown with an empty label string.
Actual behavior:
Fatal TypeError — file list module is completely unusable.
Workaround:
XCLASS on FileList that adds ?? ‘’ to the getLabel() call.
Reviews 2
Files 1
History 2024
-
Garvin Hicking commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2026-03-19T08:11:30+00:00" > 03/19/26, 08:11 </span> -
Robert Hafenried commented <span data-processor="relativetime" data-value="2026-03-25T11:14:37+00:00" > 03/25/26, 11:14 </span>
Yes, I’ll provide a patch – will submit it in the next days.
-
Gerrit Code Review pushed patch set 1 for main to change 93355 status
Needs FeedbackUnder Review <span data-processor="relativetime" data-value="2026-03-25T19:33:32+00:00" > 03/25/26, 19:33 </span> -
Robert Hafenried commented <span data-processor="relativetime" data-value="2026-03-25T19:36:20+00:00" > 03/25/26, 19:36 </span>
„Patch submitted for review: https://review.typo3.org/c/Packages/TYPO3.CMS/+/93355”
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2026-03-25T20:13:57+00:00" > 03/25/26, 20:13 </span>
Thank you – I’m currently not able to reproduce the type error though. Could you tell me if I need a specific setup?
-
Robert Hafenried commented and changed attached typo3-filelist-typeerror-stacktrace.txt <span data-processor="relativetime" data-value="2026-03-25T20:46:57+00:00" > 03/25/26, 20:46 </span>
I can reproduce the error on a TYPO3 14.2.dev installation simply by opening the file list module (Filelist) in the backend. No specific extension is required – the stack trace shows the error occurs in FileList::getFieldLabel(). I’m attaching the full stack trace:
TypeError: TYPO3\CMS\Core\Localization\LanguageService::translateLabel():
Argument #2 ($fallback) must be of type string, null given, called in
vendor/typo3/cms-filelist/Classes/FileList.php on line 1716
TYPO3 Version: 14.2.dev
PHP Version: 8.3 -
Gerrit Code Review pushed patch set 2 for main to change 93355 <span data-processor="relativetime" data-value="2026-03-25T21:28:15+00:00" > 03/25/26, 21:28 </span>
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2026-03-26T09:50:43+00:00" > 03/26/26, 09:50 </span>
I can’t reproduce that in my setup.
Could you please check out your FieldList.php file and tell me what at line 489:
protected function renderListTableFieldHeader(string $field): string { $label = $this->getFieldLabel($field);is contained in
$fieldwhen this error is triggered? Did you maybe enhance sys_file with custom fields that have no labels?This would help me to better understand the fix.
-
Robert Hafenried commented <span data-processor="relativetime" data-value="2026-03-26T10:00:43+00:00" > 03/26/26, 10:00 </span>
„The field is caption of sys_file_metadata. No custom fields have been added. Further debugging showed:
TcaSchemaFactory::has(‘sys_file_metadata’) returns true
$schema->hasField(‘caption’) returns falseSo the schema recognizes the table but does not recognize caption as a field, even though it is a standard sys_file_metadata field. This causes $label to be null, which is then passed to translateLabel().”
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2026-03-26T11:31:45+00:00" > 03/26/26, 11:31 </span>
Do you have EXT:filemetadata active and installed?
If you go to https://yoursite/typo3/module/system/config?tree=tca and check sys_file_metadata -> colums -> caption – do you see label “filemetadata.db:sys_file_metadata.caption” referenced there?
We’re getting closer! :) Thanks!
-
Robert Hafenried commented <span data-processor="relativetime" data-value="2026-03-26T11:45:36+00:00" > 03/26/26, 11:45 </span>
Good question!
EXT:filemetadata is not installed – there is no version compatible with TYPO3 14.2 yet (latest is for 14.1.1). So the caption field is apparently added to sys_file_metadata by EXT:filemetadata, which is missing in my setup. This explains why $schema->hasField(‘caption’) returns false.
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2026-03-26T13:13:24+00:00" > 03/26/26, 13:13 </span>
Do you use composeer? The extension is shipped in the core so it should match the base version you are using.
Thats quite odd!
-
Robert Hafenried commented <span data-processor="relativetime" data-value="2026-03-26T15:10:04+00:00" > 03/26/26, 15:10 </span>
Yes, it’s a ddev installation with composer.
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2026-03-26T17:36:28+00:00" > 03/26/26, 17:36 </span>
Whats your exact composer.json then? Filemetadata should have a dev-main alias too that you can use.
-
Robert Hafenried commented <span data-processor="relativetime" data-value="2026-03-26T18:10:07+00:00" > 03/26/26, 18:10 </span>
{
“name”: “typo3/cms-base-distribution”,
“description”: “TYPO3 CMS Base Distribution”,
“license”: “GPL-2.0-or-later”,
“type”: “project”,
“config”: {
“allow-plugins”: {
“typo3/class-alias-loader”: true,
“typo3/cms-composer-installers”: true
},
“platform”: {
“php”: “8.2.0“
},
“sort-packages”: true,
“minimum-stability”: “dev”,
“prefer-stable”: true
},
“require”: {
“typo3/cms-backend”: “14.2.x-dev”,
“typo3/cms-belog”: “14.2.x-dev”,
“typo3/cms-beuser”: “14.2.x-dev”,
“typo3/cms-core”: “14.2.x-dev”,
“typo3/cms-dashboard”: “14.2.x-dev”,
“typo3/cms-extbase”: “14.2.x-dev”,
“typo3/cms-felogin”: “14.2.x-dev”,
“typo3/cms-filelist”: “14.2.x-dev”,
“typo3/cms-fluid”: “14.2.x-dev”,
“typo3/cms-fluid-styled-content”: “14.2.x-dev”,
“typo3/cms-form”: “14.2.x-dev”,
“typo3/cms-frontend”: “14.2.x-dev”,
“typo3/cms-impexp”: “14.2.x-dev”,
“typo3/cms-info”: “14.2.x-dev”,
“typo3/cms-install”: “14.2.x-dev”,
“typo3/cms-reactions”: “14.2.x-dev”,
“typo3/cms-recycler”: “14.2.x-dev”,
“typo3/cms-rte-ckeditor”: “14.2.x-dev”,
“typo3/cms-seo”: “14.2.x-dev”,
“typo3/cms-setup”: “14.2.x-dev”,
“typo3/cms-sys-note”: “14.2.x-dev”,
“typo3/cms-tstemplate”: “14.2.x-dev”,
“typo3/cms-viewpage”: “14.2.x-dev”,
“typo3/cms-webhooks”: “14.2.x-dev”,
“typo3/minimal”: “dev-main“
},
“repositories”: {
“packages”: {
“type”: “path”,
“url”: “./packages/*“
}
}
} -
Ravi Sachaniya commented <span data-processor="relativetime" data-value="2026-03-27T06:37:06+00:00" > 03/27/26, 06:37 </span>
I can not reproduce either
-
Robert Hafenried commented <span data-processor="relativetime" data-value="2026-03-27T09:43:17+00:00" > 03/27/26, 09:43 </span>
I found the root cause: I’m using the database from a TYPO3 13 installation where EXT:filemetadata was installed. The field caption still exists in the database (sys_file_metadata.caption of type longtext), but since there is no compatible version of EXT:filemetadata for TYPO3 14.2, the extension is not installed and the field is not registered in TCA. This causes hasField(‘caption’) to return false and $label to be null.
So this is not a general bug but a specific migration scenario. However, the patch would still protect against such situations where database fields exist but are not registered in TCA.After further investigation, I found the actual root cause: the field caption was stored as a selected display column in be_users.uc from the TYPO3 13 installation. Clearing the user configuration (UPDATE be_users SET uc = ‘’ WHERE uid = 1) resolved the issue immediately.
So the trigger is not the database field itself, but a stale column selection in the backend user preferences referencing a field that no longer exists in TCA. The patch would still be a useful safeguard against this kind of situation. -
Garvin Hicking commented <span data-processor="relativetime" data-value="2026-03-27T10:36:50+00:00" > 03/27/26, 10:36 </span>
I came to the same conclusion and will provide an alternate patch.
-
Gerrit Code Review pushed patch set 3 for main to change 93355 <span data-processor="relativetime" data-value="2026-03-27T10:41:04+00:00" > 03/27/26, 10:41 </span>
-
Robert Hafenried commented <span data-processor="relativetime" data-value="2026-03-27T10:47:57+00:00" > 03/27/26, 10:47 </span>
Thanks for the more comprehensive fix! The root cause approach in setColumnsToRender() is much better than my symptom fix.
-
Gerrit Code Review pushed patch set 4 for main to change 93355 <span data-processor="relativetime" data-value="2026-03-27T13:29:15+00:00" > 03/27/26, 13:29 </span>
-
Garvin Hicking commented <span data-processor="relativetime" data-value="2026-03-27T16:28:25+00:00" > 03/27/26, 16:28 </span>
Thanks so much for giving feedback here, that was well worth it! :)
-
Robert Hafenried commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-03-29T09:20:13+00:00" > 03/29/26, 09:20 </span>Applied in changeset commit:4d0ac90fce3f8c63f23694ada2c46eec73da16e7.
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2026-03-31T08:09:39+00:00" > 03/31/26, 08:09 </span>
Would you like to create a patch for review? Then it can be attributed to you and tested in the CI.
Thanks!