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

BUG: Exceptions when using UncacheViewHelper on TYPO3 12 #1894

Open
Ceremony64 opened this issue Jan 9, 2024 · 10 comments · May be fixed by #1898
Open

BUG: Exceptions when using UncacheViewHelper on TYPO3 12 #1894

Ceremony64 opened this issue Jan 9, 2024 · 10 comments · May be fixed by #1898

Comments

@Ceremony64
Copy link
Contributor

I have checked that the bug exists in the dev-development branch
Yes

I have checked that there are no already open issues or recently closed issues about this bug
Yes

Describe the bug
On Typo3, the uncache viewhelper (v:render.uncache) is not working, throwing the following error:
FluidTYPO3\Vhs\Utility\RequestResolver::resolveRequestFromRenderingContext(): Return value must be of type TYPO3\CMS\Extbase\Mvc\RequestInterface, TYPO3\CMS\Core\Http\ServerRequest returned

To Reproduce
Try rendering a partial template using the v:render.uncache viewhelper in a template on a Typo3 v12 setup.

Expected behavior
Show a fresh render of the partial view

Screenshots
image

Additional context
A patch fixing both the mentioned issue and the subsequent error Given request must have an attribute "extbase" of type ExtbaseAttribute already exists (see #1872) and I can confirm that it fixes the viewhelper on Typo3 v12.

@NamelessCoder
Copy link
Member

I need a bit more context. As mentioned in #1872, the ViewHelper has been tested on v12 and is working. There must be something specific about your use case that causes the Request held by RenderingContext to be an unexpected class, so please describe a bit about what you're actually doing.

@Ceremony64
Copy link
Contributor Author

No official release nor the current development branch includes the pull request's changes that fixes the viewhelper in typo3 v12. Since there was no coresponding issue to track this bug, I created this one here, in hopes for the pull request to be merged.
The pull request #1872 addresses the issues both @sk-foresite and myself ran into when trying the viewhelper on typo3 v12.

So once the mentioned pull request gets merged, this issue would be solved.

@NamelessCoder
Copy link
Member

I have to first understand the cause for the issue - like I said, this doesn't happen in the test cases that I have. The pull request as-is cannot be merged since it breaks backwards compatibility but I can't know what the right way to solve that problem is, without first knowing why this appears to be a problem for you and not for me.

And since you posted a screenshot of the error I assume that you've got some use case set up that would trigger the issue. Which is why I asked you (like I also asked @sk-foresite) to provide more information about the context. Otherwise I cannot solve the problem for you!

@Ceremony64
Copy link
Contributor Author

The context is in the frontend and the viewhelper is used in a partial template of the websites html templates. Thus it is not used by a content element plugin. Maybe that is what is different?

P.S. I am using the uncache viewhelper to display the name of the logged in user in the header.

@NamelessCoder
Copy link
Member

So, sounds like FLUIDTEMPLATE TS object at page level - is Flux's page feature or another third-party ext for page templating involved?

@Ceremony64
Copy link
Contributor Author

Correct, FLUIDTEMPLATE at page level. No other templating extension such as Flux nor TemplaVoilà are currently used or even installed

@NamelessCoder
Copy link
Member

Thanks - I'll see if I can reproduce it and take it from there!

@medarob
Copy link

medarob commented Jan 26, 2024

Not sure if that is related in some way:

Can someone check if there is in error when using the admin panel?
We updated to VHS 7 and we got an old error back:
#1756 (comment)

@Ceremony64
Copy link
Contributor Author

Ceremony64 commented Feb 12, 2024

Thanks - I'll see if I can reproduce it and take it from there!

Were you able to replicate the issue?

@Ceremony64 Ceremony64 linked a pull request Feb 13, 2024 that will close this issue
@Ceremony64
Copy link
Contributor Author

Ceremony64 commented Feb 13, 2024

I have prepared a new pull request #1898. It fixes this issue and another regression that came with the v7 update, tho it only affected Typo3 v10

It should not break backward compatiblity with both v10 and v11 in either context (with or without extbase)

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 a pull request may close this issue.

3 participants