Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TemplateViewHelper - Exception when used in context without request #1915

Open
haraldglaser opened this issue Sep 3, 2024 · 0 comments
Open

Comments

@haraldglaser
Copy link

This patch in merged pull request "Assign resolved Request in TemplateViewHelper #1907" leads to an error if the template containing the viewhelper does not contain the necessary information for RequestResolver::resolveRequestFromRenderingContext to resolve a request.

I think it's a legitimate use to include this viewhelper in a template which itself has no request attached. In this case in my opinion it shouldn't throw an error but proceed without setting a request on the targeted view.

My actual usecase: this viewhelper is part of a custom backend preview (https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/ContentElements/CustomBackendPreview.html#ConfigureCE-Preview-PageTSconfig). As this feature uses a StandaloneView without further configuration, there is no easy way to use partials (at least none I am aware of). Prior to the change in the pull request it was possible to use the TemplateViewHelper to "simulate" partials.
This now fails with message "Unable to resolve request from RenderingContext" thrown in RequestResolver::resolveRequestFromRenderingContext.

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

No branches or pull requests

1 participant