[BUGFIX] Filename not displayed in selector (file_reference) 81/23681/3
authorMartin Borer <mbarts@gmx.ch>
Thu, 5 Sep 2013 21:29:49 +0000 (23:29 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Mon, 9 Sep 2013 18:56:58 +0000 (20:56 +0200)
The selector values in BE-fields with type group->file_reference are
empty. The filename should be displayed at this place.

Resolves: #47414
Releases: 6.2, 6.1, 6.0
Change-Id: I9fa237d2cd14ff0e9b347736090bd2171eb8a747
Reviewed-on: https://review.typo3.org/23681
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/backend/Classes/Form/DataPreprocessor.php
typo3/sysext/backend/Classes/Form/FormEngine.php

index 0ece46e..dc2e219 100644 (file)
@@ -332,6 +332,7 @@ class DataPreprocessor {
         */
        public function renderRecord_groupProc($data, $fieldConfig, $TSconfig, $table, $row, $field) {
                switch ($fieldConfig['config']['internal_type']) {
+               case 'file_reference':
                case 'file':
                        // Init array used to accumulate the files:
                        $dataAcc = array();
@@ -342,14 +343,14 @@ class DataPreprocessor {
                                // Setting dummy startup
                                foreach ($loadDB->itemArray as $value) {
                                        if ($value['id']) {
-                                               $dataAcc[] = rawurlencode($value['id']) . '|' . rawurlencode($value['id']);
+                                               $dataAcc[] = rawurlencode($value['id']) . '|' . rawurlencode(\TYPO3\CMS\Core\Utility\PathUtility::basename($value['id']));
                                        }
                                }
                        } else {
-                               $fileList = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $data, 1);
+                               $fileList = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $data, TRUE);
                                foreach ($fileList as $value) {
                                        if ($value) {
-                                               $dataAcc[] = rawurlencode($value) . '|' . rawurlencode($value);
+                                               $dataAcc[] = rawurlencode($value) . '|' . rawurlencode(\TYPO3\CMS\Core\Utility\PathUtility::basename($value));
                                        }
                                }
                        }
@@ -929,4 +930,4 @@ class DataPreprocessor {
 }
 
 
-?>
\ No newline at end of file
+?>
index 67016aa..59a3b29 100644 (file)
@@ -3696,7 +3696,7 @@ function ' . $evalData . '(value) {
                                foreach ($itemArray as $item) {
                                        $itemParts = explode('|', $item);
                                        $uidList[] = ($pUid = ($pTitle = $itemParts[0]));
-                                       $title = htmlspecialchars(basename(rawurldecode($itemParts[1])));
+                                       $title = htmlspecialchars(rawurldecode($itemParts[1]));
                                        $opt[] = '<option value="' . htmlspecialchars(rawurldecode($itemParts[0])) . '" title="' . $title . '">' . $title . '</option>';
                                }
                                break;