Skip to content

[BUGFIX] Load server request from rendering context#1964

Draft
cweiske wants to merge 1 commit intoFluidTYPO3:developmentfrom
mogic-le:content-object-fix
Draft

[BUGFIX] Load server request from rendering context#1964
cweiske wants to merge 1 commit intoFluidTYPO3:developmentfrom
mogic-le:content-object-fix

Conversation

@cweiske
Copy link
Copy Markdown
Contributor

@cweiske cweiske commented Jan 16, 2026

Since commit 9912916

[BUGFIX] Always fetch ContentObject from request in TYPO3v12+

the current content element is not available anymore in view helpers unless passed manually ("v:content.resource.fal(record: record)"). This leads to e.g. "v:content.resources.fal" not loading images anymore.

The current content object is part of the Request object. A new request object is created when a new content element is rendered. This is not $GLOBALS['TYPO3_REQUEST'] - the per-element request object gets passed to each view helper via the rendering context.

The rendering context API changed with TYPO3 v13[1], making it necessary to first try the attribute (TYPO3 v13+) and fall back to getRequest() in TYPO3v12.

[1] https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.3/Deprecation-104684-FluidRenderingContext-getRequest.html

Resolves: #1937


I've successfully tested it with image content elements that use v:content.resource.fal on TYPO3 v12.

@cweiske cweiske marked this pull request as draft January 16, 2026 09:06
@cweiske cweiske force-pushed the content-object-fix branch 4 times, most recently from 8cf7f84 to 7a1bd86 Compare January 16, 2026 09:21
Since commit 9912916
> [BUGFIX] Always fetch ContentObject from request in TYPO3v12+

the current content element is not available anymore in view helpers
unless passed manually ("v:content.resource.fal(record: record)").
This leads to e.g. "v:content.resources.fal" not loading images anymore.

The current content object is part of the Request object.
A new request object is created when a new content element is rendered.
This is not $GLOBALS['TYPO3_REQUEST'] - the per-element request object
gets passed to each view helper via the rendering context.

The rendering context API changed with TYPO3 v13[1], making it necessary
to first try the attribute (TYPO3 v13+) and fall back to getRequest()
in TYPO3v12.

[1] https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/13.3/Deprecation-104684-FluidRenderingContext-getRequest.html

Resolves: FluidTYPO3#1937
@cweiske cweiske force-pushed the content-object-fix branch from 7a1bd86 to a4ae4ed Compare January 16, 2026 09:23
@cweiske
Copy link
Copy Markdown
Contributor Author

cweiske commented Jan 16, 2026

Getting the Tests run under TYPO3 v13 is a hard task...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: content.resources.fal returns an empty array in version 7.1.0

1 participant