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

Unable to navigate to a page by their translated url #752

Open
lunfel opened this issue Dec 14, 2024 · 0 comments
Open

Unable to navigate to a page by their translated url #752

lunfel opened this issue Dec 14, 2024 · 0 comments

Comments

@lunfel
Copy link

lunfel commented Dec 14, 2024

I have recently updated an octobercms site from V1 to V3. Now the migration is almost complete, but there is one thing I am not able to fix as of right now and it is the translated url for the pages. Since the translations are now based on the new multisite concept, it seems that the url translation feature does not work anymore.

I have a page setup like so

url = "/historique"
layout = "default"
title = "Historique"
is_hidden = 0
meta_title = "Historique"
meta_description = "Historique"
robot_index = "index"
robot_follow = "follow"

[viewBag]
localeUrl[en] = "/history"
seo_title = "Historique"
seo_description = "Historique"
robot_index = "index"
robot_follow = "follow"
==
(...)

So I expect that I can naviguate to /fr/historique and /en/history, but this is not the case. /en/history will return a 404, but /en/historique will be english translated page I would expect to be served from /en/history.

At the bottom of my site, I have a locale switcher which shows both languages.

[sitePicker]
==
{% for site in sitePicker.sites %}
{% if site.code == this.site.code %}
{{ ('languages.' ~ site.code) | _ }}
{% else %}
<a href="{{ site.url }}">{{ ('languages.' ~ site.code) | _ }}</a>
{% endif %}
{% if not loop.last %} | {% endif %}
{% endfor %}

Here is my multisite configuration

2024-12-14_12-14

If I am on the /fr/historique page and that I click to switch to english, the url to which it will switch is /en/history, which leads to a 404.

2024-12-14_12-30

Running the app on the debugger, shows that it is actually trying to translate the 404 page url.

2024-12-14_12-24

My understanding is that the octobercms route does not have the custom url registered, so it is falling back to the 404 route.

Here are the plugins I have on my site

Plugin Current Version Latest Version
Blog 1.7.1 1.7.1
MailChimp 1.0.5 1.0.5
Sitemap 1.2.7 1.2.8
Translate 2.2.10 2.2.10
User 3.1.3 3.2.0
Drivers 2.0.1 2.0.1
Google Tag Manager 2.0.1 2.0.1
Fencus Google Maps Widgets 1.0.7 1.0.7
SEO Manager 5.0.6 5.0.6
Twig Extensions 2.0.5 2.0.5
Simple Contact 2.0.3 2.0.3

I suspect my problem is related to this issue #298

I have also read and applied the migration guide

What am I missing to fix this problem?

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

1 participant