[BUGFIX] Remove orderBy in count query 38/54638/2
authorSusanne Moog <susanne.moog@typo3.com>
Tue, 14 Nov 2017 14:19:25 +0000 (15:19 +0100)
committerGeorg Ringer <georg.ringer@gmail.com>
Tue, 14 Nov 2017 14:30:32 +0000 (15:30 +0100)
OrderBy does not make sense in a count only query and
fails on SQL Server, hence it is removed.

Change-Id: I676d1913f75c29dd71345dbc0f626e99df0d242f
Resolves: #82994
Releases: master
Reviewed-on: https://review.typo3.org/54638
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Jan Stockfisch <jan.stockfisch@googlemail.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/backend/Classes/Tree/Pagetree/DataProvider.php

index 5e86582..e54f036 100644 (file)
@@ -556,8 +556,7 @@ class DataProvider extends \TYPO3\CMS\Backend\Tree\AbstractTreeDataProvider
                 QueryHelper::stripLogicalOperatorPrefix($GLOBALS['BE_USER']->getPagePermsClause(1)),
                 // Only show records in default language
                 $queryBuilder->expr()->eq('sys_language_uid', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT))
-            )
-            ->orderBy('sorting');
+            );
         if ((int)$id >= 0) {
             $queryBuilder->andWhere(
                 $queryBuilder->expr()->eq('pid', $queryBuilder->createNamedParameter($id, \PDO::PARAM_INT))