#109850It is not API-confoming possible to get the Request object in custom DataProcessors in v14
Description
When having a custom DataProcessor in v14, it is currently not possible to get the request object in a public-API-conforming way.
ContentObjectRenderer::getRequest()is marked as internal ( no public API).- When calling it anyway you get a deprecation notice when it implicitly accesses the GLOBALS ( deprecated API).
- If you call setRequest beforehand (to prevent the deprecation warning) you have to pass the request from the GLOBALS, which is not desired ( unsafe API), see https://docs.typo3.org/m/typo3/reference-coreapi/14.3/en-us/ApiOverview/RequestLifeCycle/Typo3Request.html#last-resort-global-variable
> Changed in version 14.0
>
> The global request variable is a compatibility layer and is no longer guaranteed to be available in all execution contexts.
No matter how one accesses the request object in a v14 custom DataProcessor: it is either deprecated, internal or documented to be “the wrong way”.
What is the intended way to access it in a custom DataProcessor?
(I know that accessing GLOBALS will still work here technically without log entry – that is not my report. My report is that 1) the documentation is off and 2) the code markings as deprecated/internal are inconsistent to the docs)
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 4
-
Garvin Hicking commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2026-05-19T12:44:12+00:00" > 05/19/26, 12:44 </span> -
S P commented <span data-processor="relativetime" data-value="2026-05-20T05:21:25+00:00" > 05/20/26, 05:21 </span>
Thanks for the clarification. Maybe an explicit hint in the documentation about the Request object in custom DataProcessors about this situation would be best added via this ticket. Currently the docs have nothing explicit about this really:
- Nothing: https://docs.typo3.org/m/typo3/reference-coreapi/14.3/en-us/ApiOverview/ContentElements/CustomDataProcessing.html
- Incomplete (tells to use internal
getRequest()): https://docs.typo3.org/m/typo3/reference-coreapi/14.3/en-us/ApiOverview/RequestLifeCycle/Typo3Request.html#typo3-request-data-processor
-
Garvin Hicking commented and changed status
Needs FeedbackClosed <span data-processor="relativetime" data-value="2026-05-20T08:25:47+00:00" > 05/20/26, 08:25 </span>Thanks! I’ve created this PR for the docs:
https://github.com/TYPO3-Documentation/TYPO3CMS-Reference-CoreApi/pull/6562
Please feel free to comment there if this sounds suitable to you or how we could rephrase to make it clear. Thanks!
Hi!
Thanks for the feedback. Yes, we currently sadly have no better way for this. We hopefully will be able to deal with this in v15 refactoring, when we try to cut down GLOBALS[‘TYPO3_REQUEST’], as we’re aware this needs adressing by then. Several things may then need adoption and will likely be a breaking change (deprecation first, of course).
So for now: You have to use that variable. There is no “intended way” for it, and we keep this as internal to be able to ultimately fix this.
I could either close your bug report for v14 (it will not be addressed there), or I can convert this issue to the feature request for v15, what do you think?