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

Always sort root pages by language first #2831

Merged
merged 1 commit into from
Mar 3, 2021

Conversation

aschempp
Copy link
Member

@aschempp aschempp commented Mar 3, 2021

The fix in #2819 was not correct. Luckily, merging the changes in Contao 4.11 showed the problem.

Example case:

  • Root page de
  • No index page in de
  • Root Page en
  • index page in en

The changes in #2819 would sort the english index page before any root pages. This means even if a user requests de as preferred language, she would not land on the german home page. This means the changes in #2819 need to be reverted.

While debugging the routing through route:match (thanks @dmolineus) I noticed the fallback page is not preferred if no language is given. Applying the fallback sorting fixes the initial issue in #2819 as well, most likely because bubblesort now correctly compares the necessary pages.

@aschempp aschempp added the bug label Mar 3, 2021
@aschempp aschempp added this to the 4.9 milestone Mar 3, 2021
@aschempp aschempp requested a review from leofeyer March 3, 2021 16:36
@aschempp aschempp self-assigned this Mar 3, 2021
@leofeyer leofeyer merged commit 691434e into contao:4.9 Mar 3, 2021
@aschempp aschempp deleted the bugfix/routing-language-over-root branch March 4, 2021 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants