Bug #104872
closedIncrease length of field `sys_file_metadata`.`publisher`
100%
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)
.
Updated by Leonie Philine 2 months ago
The field is defined at https://github.com/TYPO3/typo3/blob/12.4/typo3/sysext/filemetadata/ext_tables.sql#L12
Updated by Garvin Hicking 2 months 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.
Updated by Garvin Hicking 2 months 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.
Updated by Stefan Bürk 2 months 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.
Updated by Sybille Peters 2 months 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).
Updated by Gerrit Code Review 2 months 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
Updated by Garvin Hicking 2 months 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).
Updated by Garvin Hicking 2 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 45ef8b9a205f099c26d5c96a22cc3d9dd1cc636d.