Bug #45289
closedUsage of id=pageAlias is broken while logged in in BE
0%
Description
We often use pagealiases to identify pages with specific functions. When we upgraded a site from 4.5.x to 6.0.x, these pages stopped working when we were in the BE at the same time.
The Exception is #1343589451: Could not fetch page data for uid 0
This problem comes from \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->determineId(), line 1172. This line is called if you are logged in in the BE and gets the rootline for a page. Now here's the catch - while calling the $temp_sys_page->getRootLine(), $this->id is still the alias. In getRootLine, one of the first things happening is that the intval() of $this->id is determined. This number has nothing to do with the alias (if there is a number at all) - so the rootline generation is wrong at best and fails most of the time because it tries to build the rootline for page 0 (but only if we are not in a workspace at the same time)
A quick fix is to imitate the method \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->checkAndSetAlias() and tranlate the alias to an ID, then call the getRootline-stuff. To achieve this, we added following lines in the TypoScriptFrontendController, starting at line 1171 (after $temp_sys_page->init($this->showHiddenPage);)
if ($this->id && !\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->id)) { $aid = $temp_sys_page->getPageIdFromAlias($this->id); if ($aid) { $this->id = $aid; } else { $this->pageNotFound = 4; } }
This is a quite ugly workaround because it can be that $this->pageNotFound is set and then isn't respected afterwards, so the same exception would be thrown. But at the moment, this is the best we can do to help ourselves. If someone could provide a better fix or help in building one, it would be appreciated.
Updated by Gerrit Code Review almost 12 years ago
- Status changed from New to Under Review
Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18197
Updated by Gerrit Code Review almost 12 years ago
Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18197
Updated by Gerrit Code Review almost 12 years ago
Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18197
Updated by Gerrit Code Review almost 12 years ago
Patch set 4 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18197
Updated by Gerrit Code Review over 11 years ago
Patch set 5 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18197
Updated by Christian Herberger about 11 years ago
Any update if and when the patch(es) are applied to the core?
Updated by Gerrit Code Review about 11 years ago
Patch set 6 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/18197
Updated by Gerrit Code Review almost 11 years ago
Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/18197
Updated by Gerrit Code Review over 10 years ago
Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/18197
Updated by Gerrit Code Review over 10 years ago
Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/18197
Updated by Markus Klein over 10 years ago
- Status changed from Under Review to Needs Feedback
- Is Regression set to No
Is this still an issue?
I can't reproduce this on current master.
Updated by Alexander Opitz about 10 years ago
- Status changed from Needs Feedback to Closed
No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.