[BUGFIX] Group mount points that have the same parent 88/50388/2
authorMichael Stucki <michael.stucki@typo3.org>
Thu, 1 Sep 2016 13:28:34 +0000 (15:28 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Wed, 26 Oct 2016 15:01:24 +0000 (17:01 +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/50388
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/backend/Classes/Tree/Pagetree/DataProvider.php

index 2e8fd81..b7e6c4b 100644 (file)
@@ -137,6 +137,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;
@@ -159,7 +160,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);