---
title: "Deprecation: #104684 - Fluid RenderingContext->getRequest()"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:deprecation-104684-1724258020"
source: "Changelog/13.3/Deprecation-104684-FluidRenderingContext-getRequest.rst"
typo3-version: "13.3"
typo3-major: 13
type: "deprecation"
issue: 104684
forge: "https://forge.typo3.org/issues/104684"
tags: ["Fluid", "PHP-API", "NotScanned", "ext:fluid"]
rendered: "2026-09-20T18:31:11+00:00"
---

# Deprecation: #104684 - Fluid RenderingContext->getRequest() {#deprecation-104684-1724258020}

See [forge#104684](https://forge.typo3.org/issues/104684)

## Description {#description}

The following methods have been marked as deprecated in TYPO3 v13 and will
be removed with TYPO3 v14:

-   `\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext->setRequest()`
-   `\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext->getRequest()`

## Impact {#impact}

Calling above methods triggers a deprecation level log entry in TYPO3 v13 and
will trigger a fatal PHP error with TYPO3 v14.

## Affected installations {#affected-installations}

`RenderingContext->getRequest()` is a relatively common call in custom
view helpers. Instances with extensions that deliver custom view helpers may
be affected. The extension scanner is *not* configured to find potential
places since the method names are common and would lead to too many false
positives.

## Migration {#migration}

Class `\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext` of the Core
extension Fluid extends class `\TYPO3Fluid\Fluid\Core\Rendering\RenderingContext`
of Fluid standalone and adds the methods `setRequest()` and `getRequest()`.
These methods are however not part of `\TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface`.

Fluid standalone will not add these methods, since the view of this library should
stay free from direct PSR-7 `ServerRequestInterface`
dependencies. Having those
methods in ext:fluid `RenderingContext`
however collides with `RenderingContextInterface`,
which is type hinted in Fluid view helper method signatures.

Fluid standalone instead added three methods to handle arbitrary additional data
in `RenderingContextInterface`:
`setAttribute()`, `hasAttribute()`
and `getAttribute()`. Those should be used instead.

A typical usage in a view helper before:

```php
/** @var \TYPO3Fluid\Fluid\Core\Rendering\RenderingContext $renderingContext */
$renderingContext = $this->renderingContext;
$request = $renderingContext->getRequest();
```

After:

```php
// use Psr\Http\Message\ServerRequestInterface

$request = null;
if ($renderingContext->hasAttribute(ServerRequestInterface::class)) {
    $request = $renderingContext->getAttribute(ServerRequestInterface::class);
}
```

To stay compatible to previous TYPO3 versions while avoiding deprecation notices,
the following code can be used:

```php
// use Psr\Http\Message\ServerRequestInterface

if (
    method_exists($renderingContext, 'getAttribute') &&
    method_exists($renderingContext, 'hasAttribute') &&
    $renderingContext->hasAttribute(ServerRequestInterface::class)
) {
    $request = $renderingContext->getAttribute(ServerRequestInterface::class);
} else {
    $request = $renderingContext->getRequest();
}
```
