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

Page is not redirecting properly if it has different slug for each language #6742

Open
tgckpg opened this issue Oct 5, 2019 · 0 comments

Comments

@tgckpg
Copy link

commented Oct 5, 2019

Summary

Setup
Create a Page "A" in CMS

  • Set slug for the page of "A" for lang en to a
  • Set slug for the page of "A" for lang not-en to b

Expected behaviour

Page /b/ ( since this is a not-en specific slug ) should be redirected to /a/

Actual behaviour

Page /b/ is showing as /a/

Here a gif I've recorded. The last /b/ should be redirected to /a/
should-be-a

Suggested fix

Since this is a two-staged bug. First bug refers to this ticket in django.

  • i.e., apply this patch first
  • then, in cms/utils/page.py function get_page_from_path, replace the following line in the for loop
    for title in titles.iterator():
        if title.page.node.site_id != site.pk:
            continue
        if published_only and not _page_is_published(title.page):
            continue
-       title.page.title_cache = {title.language: title}
+       title.page._get_title_cache( None, False, True )

This is to cause a reload in title_cache so that when calling get_absolute_path in cms/views.py it won't fallback to the only language predefined before.

Environment

  • Python version: 3.6
  • Django version: 2.2.5
  • django CMS version: 3.4.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.