[BUGFIX] RootlineUtility does not consider foreign_sorting 71/26971/2
authorMarkus Klein <klein.t3@mfc-linz.at>
Thu, 9 Jan 2014 18:42:11 +0000 (19:42 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Tue, 21 Jan 2014 14:00:32 +0000 (15:00 +0100)
Make sure RootlineUtility::enrichWithRelationFields() does take
the TCA setting foreign_sorting into account when fetching
foreign data for the rootline cache.

Resolves: #54884
Releases: 6.2, 6.1
Change-Id: I6f8323bd5a99f9009820332c220a5637e0930712
Reviewed-on: https://review.typo3.org/26971
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/core/Classes/Utility/RootlineUtility.php

index 605e173..0013898 100644 (file)
@@ -287,7 +287,8 @@ class RootlineUtility {
                                        }
                                        $whereClause = implode(' AND ', $whereClauseParts);
                                        $whereClause .= $this->pageContext->deleteClause($table);
-                                       $rows = $this->databaseConnection->exec_SELECTgetRows('uid', $table, $whereClause);
+                                       $orderBy = isset($configuration['foreign_sortby']) ? $configuration['foreign_sortby'] : '';
+                                       $rows = $this->databaseConnection->exec_SELECTgetRows('uid', $table, $whereClause, '', $orderBy);
                                        if (!is_array($rows)) {
                                                throw new \RuntimeException('Could to resolve related records for page ' . $uid . ' and foreign_table ' . htmlspecialchars($configuration['foreign_table']), 1343589452);
                                        }