[BUGFIX] getTreeList must return comma-separated list 84/56984/2
authorGuido Schmechel <littlegee@web.de>
Tue, 13 Mar 2018 20:22:03 +0000 (21:22 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Tue, 22 May 2018 09:21:26 +0000 (11:21 +0200)
While retrieving the list with begin as argument for a
recursive call, getTreeList builds the comma-separated list
correctly.

Resolves: #83328
Releases: master, 8.7, 7.6
Change-Id: I643477dd5c0cbfb67532dd96eb0b479e0cb532b8
Reviewed-on: https://review.typo3.org/56984
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/core/Classes/Database/QueryGenerator.php

index 9cf4376..4b0b530 100644 (file)
@@ -1582,7 +1582,11 @@ class QueryGenerator
                     $theList .= ',' . $row['uid'];
                 }
                 if ($depth > 1) {
-                    $theList .= $this->getTreeList($row['uid'], $depth - 1, $begin - 1, $permClause);
+                    $theSubList = $this->getTreeList($row['uid'], $depth - 1, $begin - 1, $permClause);
+                    if (!empty($theList) && !empty($theSubList) && ($theSubList[0] !== ',')) {
+                        $theList .= ',';
+                    }
+                    $theList .= $theSubList;
                 }
             }
         }