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

Clear current language when switching sites #2957

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

dbwinger
Copy link
Contributor

@dbwinger dbwinger commented Jul 1, 2024

…is associated with the current site.

What is this pull request for?

If at least one site has multiple languages, after the language is switched in the admin/pages view, the language ID is saved to session, and switching to another site does not change the language in session, which causes that language's pages to continue to be shown.

Closes #2956

This should be backported at least to 7.1.

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

@dbwinger dbwinger requested a review from a team as a code owner July 1, 2024 18:49
Copy link

codecov bot commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.02%. Comparing base (72973ad) to head (d6de41a).
Report is 17 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2957      +/-   ##
==========================================
+ Coverage   96.00%   96.02%   +0.01%     
==========================================
  Files         232      233       +1     
  Lines        6282     6309      +27     
==========================================
+ Hits         6031     6058      +27     
  Misses        251      251              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dbwinger dbwinger force-pushed the switch-language-on-site-switch branch from c01a91e to e274774 Compare July 1, 2024 20:48
@dbwinger
Copy link
Contributor Author

@tvdeyen I don't mean to rush you but just wanted to make sure you saw this PR. I wondered if the codeclimate error caused you not to get alerted. I can't tell what the problem is there.

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this nasty bug!

Could we try a simpler solution?

app/controllers/concerns/alchemy/admin/current_language.rb Outdated Show resolved Hide resolved
@dbwinger dbwinger force-pushed the switch-language-on-site-switch branch 4 times, most recently from 3a92315 to 9773f81 Compare July 18, 2024 13:13
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Nice. Thanks

@tvdeyen tvdeyen added backport-to-7.1-stable Needs to be backported to 7.1-stable backport-to-7.2-stable Needs to be backported to 7.2-stable labels Jul 22, 2024
@tvdeyen tvdeyen changed the title Load site default language ID into session unless the one in session … Clear current language when switching sites Jul 22, 2024
@tvdeyen
Copy link
Member

tvdeyen commented Jul 22, 2024

@dbwinger would you mind to update commit message now that we changed the implementation?

@dbwinger dbwinger force-pushed the switch-language-on-site-switch branch from 9773f81 to d6de41a Compare July 22, 2024 13:44
@dbwinger
Copy link
Contributor Author

@dbwinger would you mind to update commit message now that we changed the implementation?

Done.

@tvdeyen tvdeyen enabled auto-merge July 22, 2024 13:46
@tvdeyen tvdeyen merged commit 7aa1069 into AlchemyCMS:main Jul 22, 2024
35 checks passed
@alchemycms-bot
Copy link
Collaborator

💚 All backports created successfully

Status Branch Result
7.1-stable
7.2-stable

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-7.1-stable Needs to be backported to 7.1-stable backport-to-7.2-stable Needs to be backported to 7.2-stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Page tree doesn't switch languages when another site has more than one language.
3 participants