Preferred language reset to 'en' when using Office 365 SSO

Preferred language reset to 'en' when using Office 365 SSO

by Pieterjan Heyse -
Number of replies: 6

We upgraded to Moodle 3.3.1+ this summer and are using Office 365 SSO plugins. Alls our users are SSO users and since the upgrade, no matter what, when they login their language preference gets reset to 'en'. 

I have manually changed the language to 'nl' via a database query, but since the change happens on login, when they login their language gets reset back to 'en'. This did not happen in our previous version (3.1) where we also userd the SSO plugin through Office365.

Has anyone got any idea on where to look? I can start digging through the source code, but maybe someone can tell me if there is a piece of code that changes the language according to some settings in Office365? 

Thanks, 

Pieterjan


Average of ratings: -
In reply to Pieterjan Heyse

Re: Preferred language reset to 'en' when using Office 365 SSO

by Pieterjan Heyse -

I'm talking to myself here, but have found a temporary fix. I changed line 271 in local/o365/classes/observers.php from

$updateduser->lang = 'en';

to 

$updateduser->lang = 'nl';

It would be nice if this wouldn't happen at all, can I risk commenting out this line or will it break something? Maybe someone can tell me how this should be changed to respect the site language (moodlecourse | lang)?




Average of ratings: Useful (1)
In reply to Pieterjan Heyse

Re: Preferred language reset to 'en' when using Office 365 SSO

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

Better to raise this with the plugin maintainers at https://moodle.org/plugins/local_o365 - for example by commenting on the page there, pointing them to this discussion thread (maintainers are notified about new comments on their plugins). Good luck.

Average of ratings: Useful (1)
In reply to David Mudrák

Re: Preferred language reset to 'en' when using Office 365 SSO

by Pieterjan Heyse -

Thanks, I've reported this through a comment, let's hope they notice smile

In reply to Pieterjan Heyse

Re: Preferred language reset to 'en' when using Office 365 SSO

by Jan Baan -

Hi Pieterjan,

Did you get an answer to your problem. We do have the same problem at our school.

Greetings

In reply to Jan Baan

Re: Preferred language reset to 'en' when using Office 365 SSO

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

There are some places in the plugins code that look related to this:

As I can see no answer to Pieterjan's comment on the plugin's page, let me suggest to report this problem into the plugin's issue tracker. They use tracker.moodle.org, choose project CONTRIB and component "Set: Office365". When reporting it, do not forget to give them a link to this discussion.

HTH, good luck