[BUGFIX] CE:Image - backend preview of image order 75/21975/6
authorTim Spiekerkoetter <tim.spiekerkoetter@hdnet.de>
Fri, 5 Jul 2013 20:54:01 +0000 (22:54 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sat, 6 Jul 2013 15:31:35 +0000 (17:31 +0200)
The Backend preview does not reflect the sorting of the elements in the
content element. This patch added the sorting field from the TCA to the
thumbCode method.

Resolves: #48645
Releases: 6.2, 6.1, 6.0
Change-Id: I9dcec1c2baae226aeded9c4c93d368c067c0bad2
Reviewed-on: https://review.typo3.org/21975
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/backend/Classes/Utility/BackendUtility.php

index 469b026..b211e28 100644 (file)
@@ -1506,7 +1506,18 @@ class BackendUtility {
                $thumbData = '';
                // FAL references
                if ($tcaConfig['type'] === 'inline') {
-                       $referenceUids = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid', 'sys_file_reference', 'tablenames = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_file_reference') . ' AND fieldname=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($field, 'sys_file_reference') . ' AND uid_foreign=' . intval($row['uid']) . self::deleteClause('sys_file_reference') . self::versioningPlaceholderClause('sys_file_reference'));
+                       $sortingField = isset($tcaConfig['foreign_sortby']) ? $tcaConfig['foreign_sortby'] : '';
+                       $referenceUids = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
+                               'uid',
+                               'sys_file_reference',
+                               'tablenames = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_file_reference')
+                                       . ' AND fieldname=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($field, 'sys_file_reference')
+                                       . ' AND uid_foreign=' . intval($row['uid'])
+                                       . self::deleteClause('sys_file_reference')
+                                       . self::versioningPlaceholderClause('sys_file_reference'),
+                               '',
+                               $sortingField
+                       );
                        foreach ($referenceUids as $referenceUid) {
                                $fileReferenceObject = ResourceFactory::getInstance()->getFileReferenceObject($referenceUid['uid']);
                                $fileObject = $fileReferenceObject->getOriginalFile();