[BUGFIX] Group mount points that have the same parent 49/49749/7
authorMichael Stucki <michael.stucki@typo3.org>
Thu, 1 Sep 2016 13:28:34 +0000 (15:28 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Wed, 26 Oct 2016 14:47:53 +0000 (16:47 +0200)
If options.pageTree.showPathAboveMounts is enabled in
UserTS, group mount points that have the same parent page.

Resolves: #77734
Releases: master, 7.6
Change-Id: I799f20b94725f64deb4bcd025b87b978c6751976
Reviewed-on: https://review.typo3.org/49749
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/backend/Classes/Tree/Pagetree/DataProvider.php

index bf831a4..a8554c7 100644 (file)
@@ -143,6 +143,7 @@ class DataProvider extends \TYPO3\CMS\Backend\Tree\AbstractTreeDataProvider
             }
         }
         if (is_array($subpages) && !empty($subpages)) {
+            $lastRootline = [];
             foreach ($subpages as $subpage) {
                 if (in_array($subpage['uid'], $this->hiddenRecords)) {
                     continue;
@@ -165,7 +166,10 @@ class DataProvider extends \TYPO3\CMS\Backend\Tree\AbstractTreeDataProvider
                     } else {
                         $rootline = Commands::getMountPointPath($subpage['uid']);
                     }
-                    $subNode->setReadableRootline($rootline);
+                    if ($lastRootline !== $rootline) {
+                        $subNode->setReadableRootline($rootline);
+                    }
+                    $lastRootline = $rootline;
                 }
                 if ($this->nodeCounter < $this->nodeLimit) {
                     $childNodes = $this->getNodes($subNode, $mountPoint, $level + 1);