Bug #100758
open
Viewhelpers and other things do not work outside of extbase context
Added by Markus Klein about 1 year ago.
Updated 2 months ago.
Description
Using f:form* or f:*.action viewhelpers does not work anymore outside of extbase context. For instance within StandaloneView or FLUIDTEMPLATE.
StandaloneView is regularily used for rendering e-mail and there of course links should be generated.
It should be checked if this still works:
- f:form viewhelper do correctly prefix the fieldnames. E.g. having an non-extbase plugin using StandaloneView the prefix should be like `tx_myext_pi1[name]` for a name input field
Collection of notes from other forge issues:
f:form - Exception:
(1/1) #1639821904 RuntimeException
ViewHelper f:form can be used only in extbase context and needs a request implementing extbase RequestInterface.
/vendor/typo3/cms-fluid/Classes/ViewHelpers/FormViewHelper.php line 148
f:link.action - Exception
(1/1) #1639818540 RuntimeException
ViewHelper f:link.action can be used only in extbase context and needs a request implementing extbase RequestInterface.
/vendor/typo3/cms-fluid/Classes/ViewHelpers/Link/ActionViewHelper.php line 81
In both cases the "TYPO3\CMS\Core\Http\ServerRequest object" is in the $request instead the RequestInterface.
- Related to Bug #100759: f:translate does not take overrides of labels in TypoScript into account anymore added
- Related to Bug #100760: f:translate: Provide possibility to set a default extensionName added
all three issue were planned as such. they're not bugs.
if changed again, they need proper decision, impact and analysis before. just stating different than before is not good enough.
Please consider that planning might have been insufficient and mistakes can happen.
"different than before" in this case means breaking basic stuff that has been working for years and is relied on by others outside the Core.
Christian Kuhn wrote in #note-3:
all three issue were planned as such. they're not bugs.
If so, where is the deprecation notice, that tells people this would be breaking change(s) in TYPO3 12?
Didn't find one in the official Fluid docs, where just the documentation of f:form changed in v12 but nothing pointed to those changes in v11.
If changed, they need proper decision, impact, analysis and deprecation before. Just stating planned as such is not good enough. #SCNR
It would have been easy to just remove the Extbase dependency from the ViewHelpers too with #98377, since they worked with the fake ExtbaseRequest presented by Standalone Fluid anyway - instead they are documented as requires an Extbase-Request now.
- Related to Task #98377: Avoid Extbase Request init in StandaloneView added
- Has duplicate Bug #101141: f:form and f.link.action request implementing ServerRequest instead of RequestInterface added
What is the recommended way to link to an Extbase Action from non-Extbase context now? We need to offer a migration path
- Description updated (diff)
- Related to Task #101729: [TASK] Allow f:link.action and f:uri.action without Extbase added
Just hitting this bug after working on migrating EXT:cf_google_authenticator to TYPO3 v11 and now starting pushing up to TYPO3 v12.
This extension uses a StandaloneView whose template depends on a VH I just created for TYPO3 v11 and bangs! this crashes in TYPO3 v12.
So, how to migrate f:form and f:link.action outside of an extbase context?
Do you have a planned solution, or perhaps a workaround or migration path?
Also available in: Atom
PDF