[BUGFIX] Prevent empty sorting field to be quoted and put into an array 15/53915/2
authorXavier Perseguers <xavier@typo3.org>
Tue, 5 Sep 2017 14:17:26 +0000 (16:17 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Wed, 6 Sep 2017 09:52:05 +0000 (11:52 +0200)
Change-Id: I807a888ac7d977606d94f5ad9ccdfeee07ee61ec
Resolves: #82307
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/53915
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Sebastian Fischer <typo3@evoweb.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index 78c7149..27a4b53 100644 (file)
@@ -8851,12 +8851,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);