[TASK] Doctrine: Migrate AbstractDatabaseRecordList last pieces 53/49553/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Tue, 23 Aug 2016 12:08:17 +0000 (14:08 +0200)
committerBenni Mack <benni@typo3.org>
Tue, 23 Aug 2016 12:30:45 +0000 (14:30 +0200)
Change-Id: I35e9463c96474fb1eb0459cb6d915785df7d2108
Resolves: #77605
Releases: master
Reviewed-on: https://review.typo3.org/49553
Tested-by: Bamboo TYPO3com <info@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php

index 47f786d..ff7eabd 100644 (file)
@@ -702,9 +702,18 @@ class AbstractDatabaseRecordList extends AbstractRecordList
             'FROM' => $table,
             'WHERE' => $this->getPageIdConstraint($table) . ' ' . $pC . BackendUtility::deleteClause($table) . BackendUtility::versioningPlaceholderClause($table) . ' ' . $addWhere . ' ' . $search,
             'GROUPBY' => '',
-            'ORDERBY' => $this->getDatabaseConnection()->stripOrderBy($orderBy),
             'LIMIT' => $limit
         );
+        $tempOrderBy = [];
+        foreach (QueryHelper::parseOrderBy($orderBy) as $orderPair) {
+            list($fieldName, $order) = $orderPair;
+            if ($order !== null) {
+                $tempOrderBy[] = implode(' ', $orderPair);
+            } else {
+                $tempOrderBy[] = $fieldName;
+            }
+        }
+        $queryParts['ORDERBY'] = implode(',', $tempOrderBy);
         // Filter out records that are translated, if TSconfig mod.web_list.hideTranslations is set
         if ((in_array($table, GeneralUtility::trimExplode(',', $this->hideTranslations)) || $this->hideTranslations === '*') && !empty($GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']) && $table !== 'pages_language_overlay') {
             $queryParts['WHERE'] .= ' AND ' . $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'] . '=0 ';