Bug #99434
closed
Keep the $GLOBALS variables unto redirect to install tool
Added by Franz Holzinger almost 2 years ago.
Updated almost 2 years ago.
Description
The TYPO3 backend executes a bootstrap and initializes all global variables correctly. However the administration tasks executed in the install tool do not have those variables. This breaks e.g. the feature of class replacement (former XCLASS) by
$GLOBALS['TYPO3_CONF_VARS']['SYS']['Objects'][...] .
This happens in the function \TYPO3\CMS\Install\Controller\BackendModuleController::setAuthorizedAndRedirect
$redirectLocation = PathUtility::getAbsoluteWebPath('install.php?install[controller]=' . $controller . '&install[context]=backend');
return new RedirectResponse($redirectLocation, 303);
Solution: The formerly initialized global variables must be saved in a session variable before the redirect and immediately restored after the redirect to the install tool.
See also Slack:
https://typo3.slack.com/archives/C025BQLFA/p1672171922498789
Files
- Related to Bug #98992: form DataStructureIdentifierHook uses $GLOBALS['LANG'] which may not be initialized added
- Related to Bug #95708: clear cache Hook not executed with Admin Tools -> Maintenance -> Flush Cache added
- Related to Bug #91984: Extension configuration prefills from AdditionalConfiguration and saves values to LocalConfiguration, behaving different than the normal configuration UI added
The attached patch fixes this issue.
Another patch which just reads in all ext_localconf.php files of all extensions.
- Status changed from New to Rejected
The install tool is not supposed to be xclass'able.
An installtool should be stable as hell, so no changes from third parties expected here. It’s kmho a no go to modify it except with composer patches.
Also the extension configuration has become a part of the Install Tool since the newer TYPO3 versions. If a user makes a wrong extension configuration now, then this could make the TYPO3 backend instable. It would be better to be able to autoconfigure extensions or give case specific comments in some cases. The possiblities of TYPO3 are very limited here. The usage of a class exchange by extensions does not mean that this will lead to instability. It could instead help to overcome errors.
Most parts of the Install Tool do allow XCLASSing even without this patch!
The main classes of the install tool do not support xclassing and will further continue to reduce the potential ability to do so by defining more classes as final. This is mainly because most modules do not load ext_* files, exceptions are some modules like the upgrade wizards, and those should further reduce this part as well.
The idea to transfer state from the backend to the install tool by putting state into a session is a nightmare from an architectual point of view and will not be implemented.
- Related to deleted (Bug #98992: form DataStructureIdentifierHook uses $GLOBALS['LANG'] which may not be initialized)
Also available in: Atom
PDF