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

Changed default language when using render_esi #114

Open
hual7 opened this issue Jan 22, 2022 · 1 comment
Open

Changed default language when using render_esi #114

hual7 opened this issue Jan 22, 2022 · 1 comment

Comments

@hual7
Copy link

hual7 commented Jan 22, 2022

vendor version
PHP 8.0.14
Symfony/Symfony 5.4.2, 5.3.13
Sylius/SyliusThemeBundle 2.2.0
sulu/SuluThemeBundle 3.0.2

As soon as I'm using render_esi in a template, I get a changed default language (defaultlocale@theme-name) in the symfony profiler.

{{ render_esi(controller('App\\Controller\\Website\\PageController::testPage', {
     '_portal' : request.portalKey|default('default_portal_key'),
     '_locale' : app.request.locale,
     'message': 'foo bar'
})) }}

Bildschirmfoto 2022-01-22 um 14 13 40

That's weird and symfony is using the correct selected language as fallback.

If I remove render_esi from the template all works fine.

@NeuralClone
Copy link

I realize this is an old post, but I ran into this exact problem today. Everything appears to work fine when I don't use ESI. As soon as I call render_esi, the locale blows up and that breaks everything.

I spent quite a bit of time today trying to figure out why my locale kept changing to en@vendor-theme when using render_esi. I finally pinpointed it when I realized it was appending my theme name (e.g., vendor/theme) to the actual locale. Unfortunately, the only way I've been able to fix this is by removing this bundle.

Thinking back on this, I also encountered the bug months ago before using ESI. Previewing errors with the Symfony FrameworkBundle's ErrorController also seems to trigger it.

For what it's worth, I'm also using Sulu and the SuluThemeBundle, But this appears to be a bug with this bundle and not Sulu.

Q A
PHP Version 8.1.16
Symfony Version 6.2.6
Sulu Version 2.5.7
SuluThemeBundle Version 3.1.0
SyliusThemeBundle Version 2.3

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

2 participants