[BUGFIX] Unique IDs for pagetree root nodes 46/31246/2
authorAlexander Stehlik <alexander.stehlik@gmail.com>
Fri, 21 Mar 2014 18:06:33 +0000 (19:06 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Mon, 30 Jun 2014 14:39:46 +0000 (16:39 +0200)
To make sure that every ID in the pagetree is unique in pagetrees
with a virtual root node (which is used for normal editors) the
page UIDs of the webmounts are set in the mountpoint property of
the tree nodes. This makes sure that all tree node ids are unique.

Resolves: #57163
Releases: 6.3, 6.2
Change-Id: Ia938a9bf4839524d60056d55c0186196dbd11289
Reviewed-on: https://review.typo3.org/31246
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/backend/Classes/Tree/Pagetree/DataProvider.php

index 0cad2e4..2828a68 100644 (file)
@@ -113,6 +113,7 @@ class DataProvider extends \TYPO3\CMS\Backend\Tree\AbstractTreeDataProvider {
                if ($level >= 99) {
                        return $nodeCollection;
                }
+               $isVirtualRootNode = FALSE;
                $subpages = $this->getSubpages($node->getId());
                // check if fetching subpages the "root"-page
                // and in case of a virtual root return the mountpoints as virtual "subpages"
@@ -124,6 +125,7 @@ class DataProvider extends \TYPO3\CMS\Backend\Tree\AbstractTreeDataProvider {
                                if (!in_array(0, $mountPoints)) {
                                        // using a virtual root node
                                        // so then return the mount points here as "subpages" of the first node
+                                       $isVirtualRootNode = TRUE;
                                        $subpages = array();
                                        foreach ($mountPoints as $webMountPoint) {
                                                $subpages[] = array(
@@ -142,6 +144,9 @@ class DataProvider extends \TYPO3\CMS\Backend\Tree\AbstractTreeDataProvider {
                                // must be calculated above getRecordWithWorkspaceOverlay,
                                // because the information is lost otherwise
                                $isMountPoint = $subpage['isMountPoint'] === TRUE;
+                               if ($isVirtualRootNode) {
+                                       $mountPoint = (int)$subpage['uid'];
+                               }
                                $subpage = $this->getRecordWithWorkspaceOverlay($subpage['uid'], TRUE);
                                if (!$subpage) {
                                        continue;