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

Flush rewrite rules when language changed or translation updated #7435

Merged
merged 2 commits into from Jan 19, 2024

Conversation

merkushin
Copy link
Member

Resolves #7432

Proposed Changes

  • Flush rewrite rules when the language was changed or the translation was updated.

Testing Instructions

  1. Let's assume your current Site Language is English (US) and you don't have other languages "installed".
  2. Create a course, publish it.
  3. Open it on the frontend following the link in the sidebar. Make sure it opened successfully.
  4. Go to General Settings and change Site Language to German.
  5. Go to Dashboard > Updates and update the translation.
  6. Go to the course, open the course on the frontend following the link in the sidebar. Make sure it opened without 404 error.
  7. Go to General Settings, change the language back to English (US). That means you don't need to update the translation.
  8. Go to the course, open the course on the frontend following the link in the sidebar. Make sure it opened without 404 error.

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately describe the changes
  • Acceptance criteria is met
  • Decisions are publicly documented
  • Adheres to coding standards (PHP, JavaScript, CSS, HTML)
  • All strings are translatable (without concatenation, handles plurals)
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first approach
  • New UIs match the designs
  • Different user privileges (admin, teacher, subscriber) are tested as appropriate
  • Legacy courses (course without blocks) are tested
  • Code is tested on the minimum supported PHP and WordPress versions
  • User interface changes have been tested on the latest versions of Chrome, Firefox and Safari
  • "Needs Documentation" label is added if this change requires updates to documentation
  • Known issues are created as new GitHub issues

@merkushin merkushin added this to the 4.20.2 milestone Jan 18, 2024
@merkushin merkushin requested a review from a team January 18, 2024 07:54
@merkushin merkushin self-assigned this Jan 18, 2024
Copy link

codecov bot commented Jan 18, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (406e9ed) 51.20% compared to head (52451a2) 51.20%.
Report is 1 commits behind head on trunk.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              trunk    #7435   +/-   ##
=========================================
  Coverage     51.20%   51.20%           
- Complexity    11184    11188    +4     
=========================================
  Files           614      614           
  Lines         47220    47228    +8     
  Branches        405      405           
=========================================
+ Hits          24179    24185    +6     
- Misses        22714    22716    +2     
  Partials        327      327           
Files Coverage Δ
includes/class-sensei.php 25.26% <75.00%> (+0.87%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6535ad7...52451a2. Read the comment docs.

Copy link
Contributor

@Imran92 Imran92 left a comment

Choose a reason for hiding this comment

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

Works as described 👍 I remember during the janitorials, we used to suggest users to go to Settings -> Permalinks and just click Save Changes for fixing issues like this. Doing it automatically is a nice step!

@merkushin merkushin merged commit c7675f0 into trunk Jan 19, 2024
24 checks passed
@merkushin merkushin deleted the fix/404-after-language-switch branch January 19, 2024 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not Found (404) error for courses and lessons after switching language
2 participants