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

fix: LMSDEV-6741 Query current language instead of user language #14

Merged
merged 2 commits into from
Oct 4, 2024

Conversation

sayoder-aprende
Copy link

@sayoder-aprende sayoder-aprende commented Sep 26, 2024

Reasoning for this change:

  • We need $SESSION->forcelang to be set in order for the filter chain to
    work properly. This gets set by calling the moodle lib function
    force_current_language.
  • mod_customcert was not calling force_current_language IF the user's
    language was equal to the certificate's forced language.
  • This caused the following issue: A user with language en, in a session
    where the language was set to es_mx, viewing the
    forced-English-language certificate, would see a spanish section title
    instead of an English section title.
  • As a fix, we should not worry about what the user's "preferred"
    language is when we're deciding whether to force a language. All we
    care about is the current session's language.

Reasoning for this change:

- We need $SESSION->forcelang to be set in order for the filter chain to
  work properly. This gets set by calling the moodle lib function
  force_current_language.
- mod_customcert was not calling force_current_language IF the user's
  language was equal to the certificate's forced language.
- This caused the following issue: A user with language en, in a session
  where the language was set to es_mx, viewing the
  forced-English-language certificate, would see a spanish section title
  instead of an English section title.
- As a fix, we should not worry about what the user's "preferred"
  language is when we're deciding whether to force a language. All we
  care about is the current session's language.
@sayoder-aprende sayoder-aprende changed the title Lmsdev 6741 @sayoder-aprende fix: LMSDEV-6741 Query current language instead of user language Sep 26, 2024
@sayoder-aprende sayoder-aprende changed the title @sayoder-aprende fix: LMSDEV-6741 Query current language instead of user language fix: LMSDEV-6741 Query current language instead of user language Sep 26, 2024
@petermAprende petermAprende merged commit 5677245 into aprende_4005_dev Oct 4, 2024
1 check passed
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.

3 participants