[BUGFIX] Unique IDs for pagetree root nodes
[Packages/TYPO3.CMS.git] / 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;