Project

General

Profile

Actions

Bug #92312

closed

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

Added by Sybille Peters about 4 years ago. Updated almost 4 years 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 1 (0 open1 closed)

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

Actions
Actions #1

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',
            ]
        ],

Actions #2

Updated by Sybille Peters about 4 years ago

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

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

Actions #4

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. ;)

Actions #6

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.

Actions #7

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

Actions #8

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

Actions #9

Updated by Benni Mack about 4 years ago

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

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?

Actions #11

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.

Actions #12

Updated by Benni Mack almost 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF