From 10d47935418229ee8e9908273afbc37576b68431 Mon Sep 17 00:00:00 2001 From: Helmut Hummel Date: Sun, 22 Jun 2014 12:22:43 +0200 Subject: [PATCH] Revert "[BUGFIX] Inaccessible pages on shortcuts/PageNotFound handler" This introduced a regression. It turns out that it needs more work to get all cases covered correctly. Resolves: #58728 Reverts: #16472 Releases: 6.1, 6.2, 6.3 This reverts commit 9ab3b9b5dd96ae0f955277a8997abb4bd69a66ff Change-Id: I395e052c1f31adde715f5a25f9d1716c092dd908 Reviewed-on: https://review.typo3.org/31045 Reviewed-by: Helmut Hummel Tested-by: Helmut Hummel --- .../TypoScriptFrontendController.php | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php index 45a635bf819d..7fbb5c2b0c5e 100644 --- a/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php +++ b/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php @@ -1574,14 +1574,13 @@ class TypoScriptFrontendController { * * Sets or manipulates internal variables such as: $this->id, $this->page, $this->rootLine, $this->MP, $this->pageNotFound * - * @param integer $iterations Number of loops which can be done to find a page (follow shortcuts or login pages) - * @return void - * @throws \TYPO3\CMS\Core\Error\Http\PageNotFoundException * @throws \TYPO3\CMS\Core\Error\Http\ServiceUnavailableException + * @throws \TYPO3\CMS\Core\Error\Http\PageNotFoundException + * @return void * @access private * @todo Define visibility */ - public function getPageAndRootline($iterations = 20) { + public function getPageAndRootline() { $this->page = $this->sys_page->getPage($this->id); if (!count($this->page)) { // If no page, we try to find the page before in the rootLine. @@ -1623,8 +1622,6 @@ class TypoScriptFrontendController { throw new \TYPO3\CMS\Core\Error\Http\PageNotFoundException($message, 1301648781); } } - // We found something so reset to zero - $this->pageNotFound = 0; // Is the ID a link to another page?? if ($this->page['doktype'] == \TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_SHORTCUT) { // We need to clear MP if the page is a shortcut. Reason is if the short cut goes to another page, then we LEAVE the rootline which the MP expects. @@ -1661,26 +1658,19 @@ class TypoScriptFrontendController { } // Checking for include section regarding the hidden/starttime/endtime/fe_user (that is access control of a whole subbranch!) if ($this->checkRootlineForIncludeSection()) { - $message = ''; - if (count($this->rootLine)) { - if ($iterations > 0) { - $this->pageNotFound = 0; - $el = reset($this->rootLine); - $this->id = $el['uid']; - $this->getPageAndRootline($iterations - 1); - } else { - $message = 'The requested page was not accessible due to many shortcut loops into non accessible pages!'; - } - } else { + if (!count($this->rootLine)) { $message = 'The requested page was not accessible!'; - } - if ($message) { if ($this->checkPageUnavailableHandler()) { $this->pageUnavailableAndExit($message); } else { GeneralUtility::sysLog($message, 'cms', GeneralUtility::SYSLOG_SEVERITY_ERROR); throw new \TYPO3\CMS\Core\Error\Http\ServiceUnavailableException($message, 1301648234); } + } else { + $el = reset($this->rootLine); + $this->id = $el['uid']; + $this->page = $this->sys_page->getPage($this->id); + $this->rootLine = $this->sys_page->getRootLine($this->id, $this->MP); } } } -- 2.20.1