Skip to content
Snippets Groups Projects
Commit 6af4f29e authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] Streamline TypoScriptFrontendItitialization

This patch is the result of a careful refactoring of
the TypoScriptFrontendInitialization 'body' methods.

The patch establishes the new PageInformationFactory
which does all the main lifting. It either returns
the verified PageInformation object, or throws an
early dedicated exception carrying a response from the
ErrorController when something went wrong (access
checks, language overlays ...), or a StatusException
when ErrorController itself error'ed.

When PageInformation could be determined, rendering
is dispatched to middlewares below. In case of error,
the code flow is streamlined to always *return* the
early response, so upper middlewares can kick in. This
was a mixed bag before, where such exceptions sometimes
bubbled up, skipping upper middlewares.

While most error scenarios are covered by the complex
'SiteHandling' related functional tests already, a set
of simple additional tests is set up to check for
casual things in a more obvious way.

Note the internal code flow within PageInformationFactory
can still be simplified and disentangled some more, but
the outer class communication is fine now and the
internal handling is already much more easy to follow.

As drive-by, @internal getUriToCurrentPageForRedirect()
is moved from TSFE to the consuming 'shortcut and
mountpoint redirect' middleware.

The patch also outlines flaws of the PageRepository
strategy, that becomes obvious after disentangling the
consuming code. It adds a todo on how PageRepository
could be improved. We should follow this path soon, since
the entire area with all the access and logic checks is
security relevant: We want to end up with code that is as
easy to grasp and follow as possible.

Resolves: #102856
Related: #102715
Releases: main
Change-Id: Icf65dd21ced16af521735f9af003b65ec94909c9
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82452


Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarBenni Mack <benni@typo3.org>
parent 5fc78f37
Branches
Tags
No related merge requests found
Showing
with 946 additions and 753 deletions
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