[BUGFIX] Fix clipboard thumbnail rendering 53/27653/4
authorFrans Saris <franssaris@gmail.com>
Mon, 17 Feb 2014 09:38:48 +0000 (10:38 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Mon, 17 Feb 2014 20:28:28 +0000 (21:28 +0100)
The thumbnail rendering in filelist clibboard isn't
updated to use FAL. And adding folders to clipboard
with thumbnails enabled results in a fatal error.

This changes makes sure the thumbnail is only rendered
for files and updates the thumbnail part so it uses FAL.

Resolves: #56037
Releases: 6.2, 6.1
Change-Id: I2a0eccd633f5313fed9ab94b5081c13e08892900
Reviewed-on: https://review.typo3.org/27653
Tested-by: Wouter Wolters
Reviewed-by: Wouter Wolters
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
typo3/sysext/backend/Classes/Clipboard/Clipboard.php

index 69f6c8f..93ff445 100644 (file)
@@ -365,8 +365,12 @@ class Clipboard {
                                                        $folder = $fileObject instanceof \TYPO3\CMS\Core\Resource\Folder;
                                                        $size = $folder ? '' : '(' . GeneralUtility::formatSize($fileObject->getSize()) . 'bytes)';
                                                        $icon = IconUtility::getSpriteIconForFile($folder ? 'folder' : strtolower($fileObject->getExtension()), array('style' => 'margin: 0 20px;', 'title' => $fileObject->getName() . ' ' . $size));
-                                                       if ($this->clipData['_setThumb'] && GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], $fileObject->getExtension())) {
-                                                               $thumb = '<br />' . BackendUtility::getThumbNail(($this->backPath . 'thumbs.php'), $v, ' vspace="4"');
+                                                       if (!$folder && $this->clipData['_setThumb'] && GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], $fileObject->getExtension())) {
+                                                               $processedFile = $fileObject->process(\TYPO3\CMS\Core\Resource\ProcessedFile::CONTEXT_IMAGEPREVIEW, array());
+                                                               if ($processedFile) {
+                                                                       $thumbUrl = $processedFile->getPublicUrl(TRUE);
+                                                                       $thumb .= '<br /><img src="' . $thumbUrl . '" title="' . htmlspecialchars($fileObject->getName()) . '" alt="" />';
+                                                               }
                                                        }
                                                        $lines[] = '
                                                                <tr>