From 4509b783ba85a9eb5469e4466092ec6e00b04078 Mon Sep 17 00:00:00 2001
From: Claus Due <claus@namelesscoder.net>
Date: Mon, 17 Oct 2016 17:50:17 +0200
Subject: [PATCH] [BUGFIX] Set caption and copyright filemetadata DB columns to
 TEXT

This patch changes the SQL field type of two fields on
sys_file_metadata, caption and copyright, to increase
the allowed size of content in the field.

The change is marked as a bug fix since currently, attempting
to save more than the allowed 255 chars truncates every
byte beyond the barrier.

See forge issue for further details about performance
concerns and reasoning behind increasing the size.

Change-Id: I7a407d3ed6eb4bd157330bd57b0093f3f3deb5ca
Resolves: #78149
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/50248
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Philipp Gampe <philipp.gampe@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
---
 .../TCA/Overrides/sys_file_metadata.php              | 12 ++++++------
 typo3/sysext/filemetadata/ext_tables.sql             |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/typo3/sysext/filemetadata/Configuration/TCA/Overrides/sys_file_metadata.php b/typo3/sysext/filemetadata/Configuration/TCA/Overrides/sys_file_metadata.php
index 337fc45cc99a..d1e68d998f28 100644
--- a/typo3/sysext/filemetadata/Configuration/TCA/Overrides/sys_file_metadata.php
+++ b/typo3/sysext/filemetadata/Configuration/TCA/Overrides/sys_file_metadata.php
@@ -165,9 +165,9 @@ $tca = [
             'l10n_mode' => 'prefixLangTitle',
             'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.caption',
             'config' => [
-                'type' => 'input',
-                'size' => 30,
-                'eval' => 'trim'
+                'type' => 'text',
+                'cols' => 40,
+                'rows' => 3,
             ],
         ],
         'creator_tool' => [
@@ -227,9 +227,9 @@ $tca = [
             'exclude' => true,
             'label' => 'LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.copyright',
             'config' => [
-                'type' => 'input',
-                'size' => 20,
-                'eval' => 'trim'
+                'type' => 'text',
+                'cols' => 40,
+                'rows' => 3,
             ],
         ],
         'location_country' => [
diff --git a/typo3/sysext/filemetadata/ext_tables.sql b/typo3/sysext/filemetadata/ext_tables.sql
index 25e3a7669b7e..b08bfd388466 100644
--- a/typo3/sysext/filemetadata/ext_tables.sql
+++ b/typo3/sysext/filemetadata/ext_tables.sql
@@ -5,13 +5,13 @@ CREATE TABLE sys_file_metadata (
 	visible int(11) unsigned DEFAULT '1',
 	status varchar(24) DEFAULT '',
 	keywords text,
-	caption varchar(255) DEFAULT '',
+	caption text,
 	creator_tool varchar(255) DEFAULT '',
 	download_name varchar(255) DEFAULT '',
 	creator varchar(255) DEFAULT '',
 	publisher varchar(45) DEFAULT '',
 	source varchar(255) DEFAULT '',
-	copyright varchar(255) DEFAULT '',
+	copyright text,
 	location_country varchar(45) DEFAULT '',
 	location_region varchar(45) DEFAULT '',
 	location_city varchar(45) DEFAULT '',
-- 
GitLab