Commit c017900f authored by Helmut Hummel's avatar Helmut Hummel
Browse files

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 9ab3b9b5

Change-Id: I395e052c1f31adde715f5a25f9d1716c092dd908
Reviewed-on: https://review.typo3.org/31039
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
parent 9fe94376
......@@ -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);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment