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

prefix_default_language = False redirect behavior fixes #6851

Merged
merged 13 commits into from May 19, 2021

Conversation

zeerooth
Copy link
Contributor

@zeerooth zeerooth commented May 5, 2020

Description

This patch aims to mitigate some issues with prefix_default_language set to False, mainly redirect errors:

  • When page had a redirect set to it language prefix would ALWAYS get added at the beggining of the path
  • When user browser language was set to a language that had a prefix added to it and a user tried to enter page in other language that was a default one while prefix_default_language = False CMS would redirect them to their preferred language therefore blocking them from ever entering that page

Related resources

Checklist

  • I have opened this pull request against develop
  • I have updated the CHANGELOG.rst
  • I have added or modified the tests when changing logic

@coveralls
Copy link

coveralls commented May 5, 2020

Coverage Status

Coverage remained the same at 78.215% when pulling 0ed1f77 on Zeerooth:i18n_fixes into a4d4905 on divio:develop.

@FinalAngel
Copy link
Member

@victor-yunenko or @Aiky30 can you check if we could merge this into 3.8.x?

@zeerooth would you be able to solve the merge conflicts from master and remove the release date in the changelog?

@Aiky30 Aiky30 self-assigned this Oct 26, 2020
@goutnet goutnet added this to the 3.9.0 milestone May 19, 2021
Copy link
Contributor

@goutnet goutnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@goutnet goutnet merged commit 34a26bd into django-cms:develop May 19, 2021
fsbraun pushed a commit to fsbraun/django-cms that referenced this pull request Apr 18, 2023
…cms#6851)

* make is_language_prefix_patterns_used check for non-empty language_prefix insted of doing isinstance check on pattern only
* if prefix patterns are used get_language_from_request normally, otherwise default
* updated CHANGELOG
* remove previous details request_language change and replace it with page model cache workaround
* fix tests
* if prefix patterns are used get_language_from_request normally, otherwise default
* add language check workaround to menus as well

Co-authored-by: Radosław Stępień <rstepien@cloudferro.com>
Co-authored-by: Florian Delizy <florian.delizy@gmail.com>
fsbraun added a commit that referenced this pull request Apr 21, 2023
…rd of #6851 to v4) (#7527)

* fix: prefix_default_language = False redirect behavior fixes (#6851)

* make is_language_prefix_patterns_used check for non-empty language_prefix insted of doing isinstance check on pattern only
* if prefix patterns are used get_language_from_request normally, otherwise default
* updated CHANGELOG
* remove previous details request_language change and replace it with page model cache workaround
* fix tests
* if prefix patterns are used get_language_from_request normally, otherwise default
* add language check workaround to menus as well

Co-authored-by: Radosław Stępień <rstepien@cloudferro.com>
Co-authored-by: Florian Delizy <florian.delizy@gmail.com>

* Fix flake8 issue

---------

Co-authored-by: Radek Stępień <rstepien@protonmail.com>
Co-authored-by: Radosław Stępień <rstepien@cloudferro.com>
Co-authored-by: Florian Delizy <florian.delizy@gmail.com>
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

Successfully merging this pull request may close these issues.

None yet

5 participants