[BUGFIX] getQuery should respect orderBy
[Packages/TYPO3.CMS.git] / typo3 / sysext / frontend / Classes / ContentObject / ContentObjectRenderer.php
index 781704c..57f299e 100644 (file)
@@ -7536,6 +7536,12 @@ class ContentObjectRenderer
             $queryBuilder->groupBy(...$queryParts['groupBy']);
         }
 
+        if (is_array($queryParts['orderBy'])) {
+            foreach ($queryParts['orderBy'] as $orderBy) {
+                $queryBuilder->addOrderBy(...$orderBy);
+            }
+        }
+
         // Fields:
         if ($conf['selectFields']) {
             $queryBuilder->selectLiteral($this->sanitizeSelectPart($conf['selectFields'], $table));