Project

General

Profile

Actions

Bug #104872

closed

Increase length of field `sys_file_metadata`.`publisher`

Added by Leonie Philine about 1 month ago. Updated 5 days ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Start date:
2024-09-10
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

Someone has reported this in EXT:extractor, but the field is part of core.

https://github.com/xperseguers/t3ext-extractor/issues/85

Selecting distinct values from `sys_file_metadata`.`publisher` at one of our projects shows many clipped values:

macOS Version 10.14.6 (Build 18G103) Quartz P
macOS Version 12.6.1 (Build 21G217) Quartz PD
macOS Version 13.2 (Build 22D49) Quartz PDFCo

However, nowadays, fields aren't silently truncated. Instead, a hard error is raised.

Since these appear to be common values, the publisher field should be extended beyond the current VARCHAR(45).

Actions #2

Updated by Garvin Hicking about 1 month ago

Just a note - you can enhance existing tables of the core in an extension. EXT:extractor could enlarge the field in its ext_table.sql definition. Also you could do that in a custom "sitepackage" installation even, to be site-specific.

Adjusting fields for "good" field lengths is always a trade-off between storage-space/performance and "usage space". sys_file_metadata is a quite integral database table, so this needs a bit of discussion.

Actions #3

Updated by Garvin Hicking about 1 month ago

  • Status changed from New to Needs Feedback

Which index lengths do you think would be useful? Are 128 for example good enough, in your experience with the extension? Ideally we should be considerate with the varchar keylengths here, especially if some people may put indexes to some of the columns that can lead to utf8mb4 limit problems.

The limit for `creator` might also be adjusted I suppose.

Actions #4

Updated by Stefan Bürk about 1 month ago

I would say that we leave it in v12 as is. If an instance need this change,
it should be done by adding it to ext_tables.sql for example to a sitepackage
along with adjusting the TCA max value (should be in sync). Or create a small
local path package with only these two things.

For v13 I would say we can increase that to ~100/120 by adjusting only the
TCA within EXT:filemetadata which will autogenerate the database schema
as long as no other extension has an `ext_tables.sql` override for it in
place.

I'd say 45 char is more than enough for the most cases. The reason to be
kind of converative here is, that not all systems has real "varchar" for
this, some uses a fixed field length without tailing spaces etc.

And that is the reasoning that if instances needs special treatment that
the override will stay, in the one or other way.

From my side, I would increase it slighty in main.

Just my five cents on that topic.

Actions #5

Updated by Sybille Peters about 1 month ago

Additionally, I had a problem with color_space, see https://github.com/xperseguers/t3ext-extractor/issues/89 (where the normalized value does not fit in the DB field of size 4). Also there were several problems before, because the metadata had wrong datatype.

While this occurred with extension "extractor" one could argue something should be in charge of making sure the metadata can be written to the DB and / or catch exceptions.

Because an exception was thrown, the width and height did also not get written to the file information which causes problems further down the line. (all with TYPO3 v12).

Actions #6

Updated by Gerrit Code Review about 1 month ago

  • Status changed from Needs Feedback to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86087

Actions #7

Updated by Garvin Hicking about 1 month ago

I've prepared a patch for this change of "publisher"

I believe the "color_space" change is something unrelated. The core defines it as a specific select item group. If another extension allows other data to be stored there, the TCA and ext_tables.sql should be modified accordingly (which should be perfectly fine).

Actions #8

Updated by Garvin Hicking about 1 month ago

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

Updated by Benni Mack 5 days ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF