[BUGFIX] Prevent empty sorting field to be quoted and put into an array 27/53927/2
authorXavier Perseguers <xavier@typo3.org>
Tue, 5 Sep 2017 14:17:26 +0000 (16:17 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Thu, 7 Sep 2017 06:25:51 +0000 (08:25 +0200)
Change-Id: I807a888ac7d977606d94f5ad9ccdfeee07ee61ec
Resolves: #82307
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/53927
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index e99bbd8..39b337f 100644 (file)
@@ -8918,12 +8918,15 @@ class DataHandler
     {
         $connection = GeneralUtility::makeInstance(ConnectionPool::class)
             ->getConnectionForTable($tableName);
+        $sortingStatement = !empty($sortingField)
+            ? [$connection->quoteIdentifier($sortingField)]
+            : null;
         /** @var PlainDataResolver $resolver */
         $resolver = GeneralUtility::makeInstance(
             PlainDataResolver::class,
             $tableName,
             $liveIds,
-            [$connection->quoteIdentifier($sortingField)]
+            $sortingStatement
         );
 
         $resolver->setWorkspaceId($this->BE_USER->workspace);