[BUGFIX] Suppress double page entry in temporary mounted pagetree 99/19799/3
authorFrank Frewer <info@frankfrewer.de>
Thu, 11 Apr 2013 16:29:55 +0000 (18:29 +0200)
committerJigal van Hemert <jigal@xs4all.nl>
Sun, 14 Apr 2013 10:18:05 +0000 (12:18 +0200)
This patch suppresses that some pages will be shown as subpages of
themselves while defining a temporary mountpoint in the pagetree and then
searching in the mounted tree.

Fixes: #47123
Releases: 6.1, 6.0, 4.7
Change-Id: I2d6f895b6b6fd110e9a4fbc163295e8c992fdb61
Reviewed-on: https://review.typo3.org/19799
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
typo3/sysext/backend/Classes/Tree/Pagetree/DataProvider.php

index 0815946..341689a 100644 (file)
@@ -244,10 +244,21 @@ class DataProvider extends \TYPO3\CMS\Backend\Tree\AbstractTreeDataProvider {
                        $amountOfRootlineElements = count($rootline);
                        for ($i = 0; $i < $amountOfRootlineElements; ++$i) {
                                $rootlineElement = $rootline[$i];
-                               if (intval($rootlineElement['pid']) === $nodeId || intval($rootlineElement['uid']) === $nodeId) {
+                               $isInWebMount = $GLOBALS['BE_USER']->isInWebMount($rootlineElement['uid']);
+                               if (!$isInWebMount
+                                       || (intval($rootlineElement['uid']) === intval($mountPoints[0])
+                                               && intval($rootlineElement['uid']) !== intval($isInWebMount))
+                               ) {
+                                       continue;
+                               }
+                               if (intval($rootlineElement['pid']) === $nodeId
+                                       || intval($rootlineElement['uid']) === $nodeId
+                                       || (intval($rootlineElement['uid']) === intval($isInWebMount)
+                                               && in_array(intval($rootlineElement['uid']), $mountPoints, TRUE))
+                               ) {
                                        $inFilteredRootline = TRUE;
                                }
-                               if (!$inFilteredRootline) {
+                               if (!$inFilteredRootline || intval($rootlineElement['uid']) === intval($mountPoint)) {
                                        continue;
                                }
                                $rootlineElement = \TYPO3\CMS\Backend\Tree\Pagetree\Commands::getNodeRecord($rootlineElement['uid']);