asdoria / SyliusLocaleSwitcherPlugin

Asdoria Locale Switcher Plugin
4 stars 3 forks source link

Problem with custom translatable model redirection #4

Open cchapleau opened 1 month ago

cchapleau commented 1 month ago

Hi,

I'm on :

With a custom translatable model, I have troubles with the redirection in the show part.

Here is an example to explain it :

from .../fr/actualite to .../en/actutality :

app_front_actuality_index:
    path:
        fr: /{_locale}/actualite
        en: /{_locale}/actuality
    methods: [GET]
    defaults:
        _controller: app.controller.actuality::actuality_index

from .../fr/actualite/mon-premier-article to .../en/actuality/my-first-article :

app_front_actuality_show:
    path:
        fr: /{_locale}/actualite/{slug}
        en: /{_locale}/actuality/{slug}
    methods: [GET]
    defaults:
        _controller: app.controller.actuality::actuality_show

I notice that when debugging my route app_front_actuality_show, the alias is null. Is it normal that it doesn't work for me or I've done something wrong with the plugin ? Or maybe, my custom translatable model's configuration miss something ?

Thank you so much in advance for your reply and your help.

cchapleau commented 1 week ago

Hi, I see another problem. When we have products with 2 different slug (EN + FR), the redirection failed too in :

Hope it will be fixed soon.