From dcd8920ea1db57a051672f4096cbc1d54a07e11e Mon Sep 17 00:00:00 2001
From: Susanne Moog <susanne.moog@typo3.org>
Date: Wed, 12 Sep 2018 18:15:25 +0200
Subject: [PATCH] [BUGFIX] Allow recycler page in rootline in BE

The recycler doktype should be allowed in rootline in BE.

Resolves: #86209
Releases: master
Change-Id: I173c2deca5cd395d566a6fd9d6499538ef20d2e6
Reviewed-on: https://review.typo3.org/58243
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Joerg Kummer <typo3@enobe.de>
Tested-by: Joerg Kummer <typo3@enobe.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
---
 .../core/Classes/Utility/RootlineUtility.php       |  6 +-----
 .../Controller/TypoScriptFrontendController.php    | 14 ++++++++++----
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/typo3/sysext/core/Classes/Utility/RootlineUtility.php b/typo3/sysext/core/Classes/Utility/RootlineUtility.php
index 5d85a6c50be2..bc93a6a7efc3 100644
--- a/typo3/sysext/core/Classes/Utility/RootlineUtility.php
+++ b/typo3/sysext/core/Classes/Utility/RootlineUtility.php
@@ -250,11 +250,7 @@ class RootlineUtility
             $row = $queryBuilder->select(...self::$rootlineFields)
                 ->from('pages')
                 ->where(
-                    $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)),
-                    $queryBuilder->expr()->neq(
-                        'doktype',
-                        $queryBuilder->createNamedParameter(PageRepository::DOKTYPE_RECYCLER, \PDO::PARAM_INT)
-                    )
+                    $queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT))
                 )
                 ->execute()
                 ->fetch();
diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
index 23a1609cd09a..370f1f70b9eb 100644
--- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
+++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
@@ -1652,15 +1652,18 @@ class TypoScriptFrontendController implements LoggerAwareInterface
      * If any page in the root line is blocking visibility, true is returend.
      *
      * All pages from the blocking page downwards are removed from the root
-     * line, so that the remaning pages can be used to relocate the page up
+     * line, so that the remaining pages can be used to relocate the page up
      * to lowest visible page.
      *
      * The blocking feature of a page must be turned on by setting the page
-     * record field 'extendToSubpages' to 1.
+     * record field 'extendToSubpages' to 1 in case of hidden, starttime,
+     * endtime or fe_group restrictions.
      *
-     * The following fields are evaluated then:
+     * Additionally this method checks for backend user sections in root line
+     * and if found evaluates if a backend user is logged in and has access.
      *
-     *      hidden, starttime, endtime, fe_group
+     * Recyclers are also checked and trigger page not found if found in root
+     * line.
      *
      * @todo Find a better name, i.e. checkVisibilityByRootLine
      * @todo Invert boolean return value. Return true if visible.
@@ -1710,6 +1713,9 @@ class TypoScriptFrontendController implements LoggerAwareInterface
                     // Don't go here, if there is no backend user logged in.
                     $removeTheRestFlag = true;
                 }
+            } elseif ((int)$this->rootLine[$a]['doktype'] === PageRepository::DOKTYPE_RECYCLER) {
+                // page is in a recycler
+                $removeTheRestFlag = true;
             }
             if ($removeTheRestFlag) {
                 // Page is 'not found' in case a subsection was found and not accessible, code 2
-- 
GitLab