[BUGFIX] Handle file_references properly in t3lib_befunc::thumbCode 34/21934/2
authorTolleiv Nietsch <info@tolleiv.de>
Fri, 5 Jul 2013 13:36:09 +0000 (15:36 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Tue, 20 Aug 2013 06:57:51 +0000 (08:57 +0200)
Group fields with internal_type "file_reference" reference the files
directly. The filepaths don't need any additional uploadFolder prefixes.

Due to the FAL changes in that method, this patch is not relevant for 6.0.

Change-Id: I7428fb9561180dd51cc1f45a9f6c012626b72fa8
Resolves: #31295
Releases: 4.5
Reviewed-on: https://review.typo3.org/21934
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
t3lib/class.t3lib_befunc.php

index cbec23e..d9186ab 100644 (file)
@@ -1856,8 +1856,12 @@ final class t3lib_BEfunc {
                t3lib_div::loadTCA($table);
 
                        // Find uploaddir automatically
-               $uploaddir = (is_null($uploaddir)) ? $TCA[$table]['columns'][$field]['config']['uploadfolder'] : $uploaddir;
-               $uploaddir = preg_replace('#/$#', '', $uploaddir);
+               if ($GLOBALS['TCA'][$table]['columns'][$field]['config']['internal_type'] == 'file_reference') {
+                       $uploaddir = '';
+               } else {
+                       $uploaddir = (is_null($uploaddir)) ? $TCA[$table]['columns'][$field]['config']['uploadfolder'] : $uploaddir;
+                       $uploaddir = preg_replace('#/$#', '', $uploaddir);
+               }
 
                        // Set thumbs-script:
                if (!$GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails']) {