From 554bcff9bcd19ed74238a718136a02215ebf4cd6 Mon Sep 17 00:00:00 2001
From: Bernd Wilke <t3A@pi-phi.de>
Date: Fri, 5 Jun 2015 09:38:43 +0200
Subject: [PATCH] [BUGFIX] Change default label for sys_file_references

In the List module you can select additional fields to be displayed.
For fields referencing files only, the uid is shown which does give
no hint to the real referenced file.
This change selects the uid_local field, which selects the filename
from sys_file for display.

Resolves: #67303
Releases: master, 6.2
Change-Id: I8dd301ff8d8d17baa67fafd26892a3eeea46509b
Reviewed-on: https://review.typo3.org/40477
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
---
 typo3/sysext/core/Configuration/TCA/sys_file_reference.php     | 3 ++-
 .../pages-and-ttcontent-with-image-but-not-included.xml        | 2 +-
 .../ImportExportXml/pages-and-ttcontent-with-image.xml         | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/typo3/sysext/core/Configuration/TCA/sys_file_reference.php b/typo3/sysext/core/Configuration/TCA/sys_file_reference.php
index 69c73fceb222..fa4c329e485d 100644
--- a/typo3/sysext/core/Configuration/TCA/sys_file_reference.php
+++ b/typo3/sysext/core/Configuration/TCA/sys_file_reference.php
@@ -2,7 +2,7 @@
 return array(
     'ctrl' => array(
         'title' => 'LLL:EXT:lang/locallang_tca.xlf:sys_file_reference',
-        'label' => 'uid',
+        'label' => 'uid_local',
         'formattedLabel_userFunc' => 'EXT:core/Classes/Resource/Service/UserFileInlineLabelService.php:TYPO3\\CMS\\Core\\Resource\\Service\\UserFileInlineLabelService->getInlineLabel',
         'formattedLabel_userFunc_options' => array(
             'sys_file' => array(
@@ -102,6 +102,7 @@ return array(
                 'type' => 'group',
                 'internal_type' => 'db',
                 'size' => 1,
+                'eval' => 'int',
                 'maxitems' => 1,
                 'minitems' => 0,
                 'allowed' => 'sys_file'
diff --git a/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image-but-not-included.xml b/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image-but-not-included.xml
index 5b24bc25def6..947084df453b 100644
--- a/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image-but-not-included.xml
+++ b/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image-but-not-included.xml
@@ -67,7 +67,7 @@
 				<rec index="1" type="array">
 					<uid>1</uid>
 					<pid>1</pid>
-					<title>1</title>
+					<title>typo3_image2.jpg</title>
 					<size>297</size>
 					<relations index="rels" type="array">
 						<element index="sys_file:1" type="array">
diff --git a/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image.xml b/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image.xml
index c9d3f8e7fdf8..47889be20bb3 100644
--- a/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image.xml
+++ b/typo3/sysext/impexp/Tests/Functional/Fixtures/ImportExportXml/pages-and-ttcontent-with-image.xml
@@ -67,7 +67,7 @@
 				<rec index="1" type="array">
 					<uid>1</uid>
 					<pid>1</pid>
-					<title>1</title>
+					<title>typo3_image2.jpg</title>
 					<size>297</size>
 					<relations index="rels" type="array">
 						<element index="sys_file:1" type="array">
-- 
GitLab