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

Locale Switcher with use_controller not working in Symfony 4 #205

Open
mikelros opened this issue Mar 28, 2018 · 2 comments
Open

Locale Switcher with use_controller not working in Symfony 4 #205

mikelros opened this issue Mar 28, 2018 · 2 comments

Comments

@mikelros
Copy link

I tried to use LocaleBundle in a Symfony 4 project that also uses flex and when I try to use LocaleSwitcher along with use_controller=true, then it triggers the following error:
'Invalid resource "/vagrant/var/cache/dev/lunetics_locale/routing.yml" passed to the "service" route loader: use the format "service_name:methodName"'
I found that this is set in RouterResourcePass which sets router.resource as /vagrant/var/cache/dev/lunetics_locale/routing.yml and it is expecting something like the kernel:loadRoutes that is loaded by default in the router config.
This is my router config (default):

framework:
    router:
        strict_requirements: ~

And this is the bundle config:

lunetics_locale:
    guessing_order:
        - router
        - session
        - browser
    allowed_locales:
        - en
        - es
        - fr
    cookie:
        set_on_change: true
    switcher:
        template: LocaleSwitcher/switcher_links.html.twig
        use_controller: true
        use_referrer: true
        redirect_to_route: homepage
        redirect_statuscode: 302

Am I doing something wrong? Or is this an incompatibility with Symfony 4?
Thanks in advance.

@dbu
Copy link
Collaborator

dbu commented Mar 28, 2018

afaik there is no testing with Symfony 4. there is #203 which tries to fix another issue in Symfony 4.

this error sounds like a change in symfony, can you check if you find a changelog or upgrade notes for what should be done? @lunetics seems not very active on this anymore, but i can also merge pull requests to help out.

@lunetics
Copy link
Collaborator

Old issue i know, but i'm currently porting to symfony 4+ / php 7.1+ only

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

3 participants