[TASK] Provide current content object as request attribute
Extbase ConfigurationManager as stateful singleton object is updated within extbase bootstrap for each plugin call. This is ugly, but since ConfigurationManager can be injected to other extbase services, which can be injected itself, it is very hard to get rid of. However, ConfigurationManager is also abused to "park" the current ContentObjectRenderer instance in this "convenient" singleton. The current content object renderer instance can then be retrieved at extbase runtime using getContentObject(). The form extension uses this at a couple of places to move the ContentObjectRenderer data around. The ConfigurationManager should however not be a source of such data, and our main "state" object in the framework is the request (which ConfigurationManager needs as well, but that's a different patch). To allow a deprecation of getContentObject() in ConfigurationManager, the patch changes the codebase to attach the current content object as request attribute instead. This is a bit fiddly as well since ContentObjectRenderer can be recursive (cObj rendering other cObj again), but the change at least makes this state more obvious, and we're pretty confident the situation will further relax and become more transparent with continued ContentObjectRenderer refactorings. Some of these have been prepared in v12 already and we'll see more on this with v13. The patch does the main refactoring, deprecating getContentObject() will follow with another patch. The patch does not add the attribute at all places where ContentObjectRenderer instances are created, more may follow later. The main goal of this patch is to create the main infrastructure and to not break the form extension. Resolves: #100623 Releases: main Change-Id: I3de7f53244c0b438ef54940d87a169068f1a832e Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77252 Tested-by:Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
Benni Mack <benni@typo3.org> Tested-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Benni Mack <benni@typo3.org> Tested-by:
core-ci <typo3@b13.com>
Showing
- typo3/sysext/extbase/Classes/Configuration/ConfigurationManager.php 1 addition, 0 deletions...xt/extbase/Classes/Configuration/ConfigurationManager.php
- typo3/sysext/extbase/Classes/Configuration/ConfigurationManagerInterface.php 1 addition, 0 deletions...e/Classes/Configuration/ConfigurationManagerInterface.php
- typo3/sysext/extbase/Classes/ContentObject/ExtbasePluginContentObject.php 2 additions, 2 deletions...base/Classes/ContentObject/ExtbasePluginContentObject.php
- typo3/sysext/extbase/Classes/Core/Bootstrap.php 12 additions, 8 deletionstypo3/sysext/extbase/Classes/Core/Bootstrap.php
- typo3/sysext/extbase/Classes/Mvc/Web/Routing/UriBuilder.php 13 additions, 25 deletionstypo3/sysext/extbase/Classes/Mvc/Web/Routing/UriBuilder.php
- typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php 0 additions, 1 deletion...ext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php
- typo3/sysext/extbase/Tests/UnitDeprecated/Mvc/Web/Routing/UriBuilderTest.php 0 additions, 1 deletion...e/Tests/UnitDeprecated/Mvc/Web/Routing/UriBuilderTest.php
- typo3/sysext/fluid/Classes/ViewHelpers/CObjectViewHelper.php 1 addition, 1 deletiontypo3/sysext/fluid/Classes/ViewHelpers/CObjectViewHelper.php
- typo3/sysext/form/Classes/Controller/FormFrontendController.php 2 additions, 2 deletions...sysext/form/Classes/Controller/FormFrontendController.php
- typo3/sysext/form/Classes/Domain/Finishers/ConfirmationFinisher.php 5 additions, 13 deletions...xt/form/Classes/Domain/Finishers/ConfirmationFinisher.php
- typo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php 3 additions, 3 deletionstypo3/sysext/form/Classes/Domain/Runtime/FormRuntime.php
- typo3/sysext/form/Tests/Functional/RequestHandling/Fixtures/Extensions/form_caching_tests/Classes/Controller/FormCachingTestsController.php 2 additions, 2 deletions...g_tests/Classes/Controller/FormCachingTestsController.php
- typo3/sysext/form/Tests/Unit/Controller/FormFrontendControllerTest.php 18 additions, 22 deletions...form/Tests/Unit/Controller/FormFrontendControllerTest.php
- typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php 27 additions, 5 deletions.../frontend/Classes/ContentObject/ContentObjectRenderer.php
- typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php 1 addition, 1 deletion...ntend/Classes/Controller/TypoScriptFrontendController.php
- typo3/sysext/frontend/Classes/DataProcessing/FlexFormProcessor.php 7 additions, 3 deletions...ext/frontend/Classes/DataProcessing/FlexFormProcessor.php
- typo3/sysext/frontend/Tests/Unit/ContentObject/CaseContentObjectTest.php 2 additions, 1 deletion...ontend/Tests/Unit/ContentObject/CaseContentObjectTest.php
- typo3/sysext/frontend/Tests/Unit/DataProcessing/FlexFormProcessorTest.php 4 additions, 0 deletions...ntend/Tests/Unit/DataProcessing/FlexFormProcessorTest.php
Please register or sign in to comment