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

$request->getPreferredFormat() is null #2101

Open
Guervyl opened this issue Aug 28, 2024 · 1 comment
Open

$request->getPreferredFormat() is null #2101

Guervyl opened this issue Aug 28, 2024 · 1 comment
Labels
Status: Waiting Feedback Needs feedback from the author Turbo

Comments

@Guervyl
Copy link

Guervyl commented Aug 28, 2024

Hi, In my controller $request->getPreferredFormat() is null whenever the page is called from ux-turbo or not.

I'm using symfony/ux-turbo: 2.12.0 with Symfony 6.2.14.

I'm using turbo stream instead of frame. When I set the a tag outside a turbo-frame $request->headers->get('Turbo-Frame') and $request->getPreferredFormat() are null.

When I add the link inside a turbo-frame I get the $request->headers->get('Turbo-Frame') but $request->getPreferredFormat() is set to Html.

The links are inside <div {{ stimulus_controller('@symfony/ux-turbo/turbo-core') }}>...</div>

@smnandre
Copy link
Collaborator

Hello @Guervyl

When I add the link inside a turbo-frame I get the $request->headers->get('Turbo-Frame') but $request- > getPreferredFormat() is set to Html.

The links are inside <div {{ stimulus_controller('@symfony/ux-turbo/turbo-core') }}>...

This part seems normal to me, right ?

Could you create a reproducer, showing clearly what result you expected and what you got ?

@smnandre smnandre added Turbo Status: Waiting Feedback Needs feedback from the author labels Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Waiting Feedback Needs feedback from the author Turbo
Projects
None yet
Development

No branches or pull requests

2 participants