#91326Upgrade to 10.x fails when using getApplicationContext in AdditionalConfiguration.php
Description
I have an AdditionalConfiguration.php with getApplicationContext for PROD, Staging and DEV environments with definition of different databases.
_(switch (\TYPO3\CMS\Core\Utility\GeneralUtility::getApplicationContext()) {….)_
When trying to upgrade to 10.x (10.4.1 in this case) the install process hangs in “Execute pre install tasks” forever.
No entries in log file.
Renaming/moving AdditionalConfiguration.php solves the issue.
same applies for for Environment, etc. when reenabeling AdditionalConfiguration.php after successful installation:
Hanging in: “Checking session and executing silent configuration update”
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Related issues 1
History 6
-
Joerg Schreiner changed is private 05/07/20, 11:14
-
Benni Mack commented and changed is private 05/22/20, 10:25
-
Joerg Schreiner commented 05/22/20, 10:50
Issue was the usage of
_\TYPO3\CMS\Core\Utility\GeneralUtility::getApplicationContext()_ in AdditionalConfiguration.php.
If you do not change this to
_\TYPO3\CMS\Core\Core\Environment::getContext()_
*BEFORE* linking typo3_src to 10.x version, the update fails as mentioned above.
Background is, that getApplicationContext() is not supported in 10.x anymore.
(I haven’t seen a deprecation notice in the logs before, but maybe I have overseen them.)
As one already moved to the 10.x sources before one try to start the upgrade process, it fails.
I think, there is no real chance, to prevent this behavior, but I would suggest to mention it in the upgrade advisory notes.Joerg
-
Benni Mack commented 05/22/20, 11:56
Joerg Schreiner wrote:
> Issue was the usage of
> \TYPO3\CMS\Core\Utility\GeneralUtility::getApplicationContext() in AdditionalConfiguration.php.
> If you do not change this to
> _\TYPO3\CMS\Core\Core\Environment::getContext()_
> BEFORE linking typo3_src to 10.x version, the update fails as mentioned above.
> Background is, that getApplicationContext() is not supported in 10.x anymore.
> (I haven’t seen a deprecation notice in the logs before, but maybe I have overseen them.)
> As one already moved to the 10.x sources before one try to start the upgrade process, it fails.
> I think, there is no real chance, to prevent this behavior, but I would suggest to mention it in the upgrade advisory notes.
>
> JoergHey Joerg,
I think the main issue that LocalConfiguration and AdditionalConfiguration is loaded at such an early time, that
a) deprecation is not set up yet at this stage
b) code migration or detection is not really possible. -
Sybille Peters changed Related to #91325 07/21/20, 13:04
-
Christian Kuhn commented and changed status
NewClosed 04/22/23, 15:00I think we should close here: getApplicationContext() has been removed in v11, and v10 will not see changes in this area anymore.
I mark this issue as non-private so other collaborators can help.