Bug #92312
closedsys_file_metadata.filelist is in TCA but not in SQL schema - may lead to exceptions
100%
Description
System¶
- 9.5.20
- master (11-dev)
I had the problem in 9.5.20 but the same seems to apply for master
Sideeffects¶
If l10nmgr is installed and a non-admin edits the file metadata in the filelist, an exception may occur.
Oops, an error occurred!
An exception occurred while executing 'SELECT `crdate`, `sys_language_uid`, `l10n_parent`, `l10n_diffsource`, `t3ver_label`, `fileinfo`, `file`, `title`, `description`, `alternative`, `width`, `height`, `categories`, `visible`, `status`, `keywords`, `caption`, `creator_tool`, `download_name`, `creator`, `publisher`, `source`, `copyright`, `location_country`, `location_region`, `location_city`, `latitude`, `longitude`, `ranking`, `content_creation_date`, `content_modification_date`, `note`, `unit`, `duration`, `color_space`, `pages`, `language`, `fe_groups`, `t3_origuid`, `uid`, `pid`, `sys_language_uid`, `l10n_diffsource`, `l10n_parent` FROM `sys_file_metadata` WHERE (`uid` = ?) AND (`sys_language_uid` <= ?) AND ((`sys_file_metadata`.`t3ver_wsid` = 0) OR (`sys_file_metadata`.`t3ver_state` <= 0))' with params [162820, 0]: Unknown column 'fileinfo' in 'field list'
Because the extensions l10nmgr reads the fields from TCA and contructs the SQL query from that. If user is admin, it just uses "*".
More info:¶
$ mysql -e "describe sys_file_metadata" t3coredev | grep fileinfo
no result.
- sys_file_metadata.filelist is defined in TCA (EXT:core)
- EXT:l10nmgr:\Localizationteam\L10nmgr\Model\Tools->getSingleRecordToTranslate() : DB query
Files
Updated by Sybille Peters about 4 years ago
It would help to enable "exclude" for sys_filemetadata.fileinfo:
'fileinfo' => [
'exclude' => true,
'config' => [
'type' => 'user',
'renderType' => 'fileInfo',
]
],
Updated by Sybille Peters about 4 years ago
- Related to Bug #46187: Missing columns sys_file.fileinfo and sys_file_meta.fileinfo added
Updated by Sybille Peters about 4 years ago
The extension l10nmgr probably should not just SELECT all fields from TCA. But fileinfo is of type "user" which should have a DB field. At least it says so in the TCA docs:
Unlike none, type user must have a database field.
https://docs.typo3.org/m/typo3/reference-tca/master/en-us/ColumnsConfig/Type/User.html#introduction
Updated by Alexander Rotzsch about 4 years ago
Hi,
we have the same backend-error-message "unknown column 'fileinfo' in 'field list" with TYPO3 9.5.21. It occurs whenever someone wants to save metadata of files, but only for non-admins and if localizationteam/l10nmgr is activated (in our case). But I think it's a potential problem for other extensions, too, as l10nmgr has no definitions for the field "fileinfo".
Note: Whilst the error is confusing for our editors, the save-operation nevertheless works.
Our workaround in EXT:extensionname/Configuration/TCA/Overrides/sys_file_metadata.php:
$GLOBALS['TCA']['sys_file_metadata']['columns']['fileinfo']['exclude'] = true;
$GLOBALS['TCA']['sys_file']['columns']['fileinfo']['exclude'] = true;
A core fix is preferred of course. ;)
Updated by Sybille Peters about 4 years ago
Added issue for l10nmgr: https://gitlab.com/coderscare/l10nmgr/-/issues/34
Updated by Jo Hasenau about 4 years ago
Fixed in L10nmgr master by introducing a check for the DB schema, still the core should provide database fields in this case or at least change the docs which would consider a DB field for "user" types mandatory.
Updated by Gerrit Code Review about 4 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66378
Updated by Gerrit Code Review about 4 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66572
Updated by Benni Mack about 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset b9262085013bc7a38b2b72c1ab95704d3c7cd705.
Updated by David Menzel almost 4 years ago
I noticed the same error in 9.5.23.
Will there be a fix for TYPO3 9.5?
Updated by Sybille Peters almost 4 years ago
What error did you notice? The error I described was in combination with l10nmgr. This has been fixed in the extension, see https://gitlab.com/coderscare/l10nmgr/-/issues/34
In the comments here you can also find some other workarounds if the problem still affects your site.
The patch https://review.typo3.org/c/Packages/TYPO3.CMS/+/66572 has not been backported to 9.5, as far as I know.
Updated by Benni Mack almost 4 years ago
- Status changed from Resolved to Closed