Bug #92312

sys_file_metadata.filelist is in TCA but not in SQL schema - may lead to exceptions

Added by Sybille Peters 9 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2020-09-15
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

exception.log (34.4 KB) exception.log Sybille Peters, 2020-09-15 14:43

Related issues

Related to TYPO3 Core - Bug #46187: Missing columns sys_file.fileinfo and sys_file_meta.fileinfoClosed2013-03-11

Actions
#1

Updated by Sybille Peters 9 months ago

It would help to enable "exclude" for sys_filemetadata.fileinfo:

'fileinfo' => [
            'exclude' => true,
            'config' => [
                'type' => 'user',
                'renderType' => 'fileInfo',
            ]
        ],

#2

Updated by Sybille Peters 9 months ago

  • Related to Bug #46187: Missing columns sys_file.fileinfo and sys_file_meta.fileinfo added
#3

Updated by Sybille Peters 9 months 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

#4

Updated by Alexander Rotzsch 8 months 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. ;)

#6

Updated by Jo Hasenau 8 months 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.

#7

Updated by Gerrit Code Review 7 months 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

#8

Updated by Gerrit Code Review 7 months 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

#9

Updated by Benni Mack 7 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#10

Updated by Dave Zen 6 months ago

I noticed the same error in 9.5.23.

Will there be a fix for TYPO3 9.5?

#11

Updated by Sybille Peters 6 months 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.

#12

Updated by Benni Mack 6 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF