[BUGFIX] Ensure correct path calculation on system build #633
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TYPO3 core
SystemEnvironmentBuilder
has been implementnormal TYPO3 usages in mind respecting possible instance
setup scenarios, to build low level system environment
before taking configuration into account.
Path calculations are based on different indicators,
for example if TYPO3 is used in composer mode based
on the PHP define() TYPO3_COMPOSER_MODE set during
by the
typo3/cms-composer-installers
composer pluginduring
composer install
actions.Per nature, PHP defines are immutable and cannot be
changed anymore during runtime.
As
typo3/testing-framework
is only installabe usingcomposer the TYPO3_COMPOSER_MODE define is always set
but is invalid for functional test instances build in
legacy mode and making invalid path calculations.
That was hidden quite some time now, and is related to
a chain of changes over a very long period of time and
finally popped up in early TYPO3 v13 development after
introducing the configurable backend url feature.
Functional tests building relative url for resources
or links could run into the issue not retrieving the
leading slash anymore due to path calculation errrors,
leading to follup issues in
NormalizedParams
createmethod when using frontend requests.
Eventually more developers run into that issue, but
simply adjusted the test expectation instead analyzing
the root of the curse and thus not reported it, which
has been done recenently.
To fix this issue changes on two fronts have to be made,
in the TYPO3 core
SystemEnvironmentBuilder
[1] andin the testing-framework implementation.
Note that only both changes together solves this issue,
as the testing-framework change alone would not be
executed due to using
self
for static method callsin the TYPO3 implementation.
[1] https://review.typo3.org/c/Packages/TYPO3.CMS/+/86569
Resolves: #577
Releases: main, 8