Institution addUserAsMember lang logic is flawed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Medium
|
Nelson |
Bug Description
The logic in charge of selecting the lang for the message does not work as expected.
The condition:
if ($lang = get_account_
// The user has a preset lang preference so we will use this
}
else if ($this->lang != 'default') {
// The user hasn't been added yet, so we have to manually use this institution's lang
$lang = $this->lang;
}
else {
$lang = get_user_
}
gets always sent in english if the site default lang is french.
To reproduce it:
You set another language than english as default language. You an institution with default lang and then you add a user (his lang preference is not setting) into this institution. He is going to receive an english message in that case and also in the case that the institution language is explicitly set to the additional lang.
That is corrected with the following:
$lang = get_account_
if ($lang == 'default') {
// The user has not a preset lang preference so we will use the institution if it has one.
);
if ($this->lang != 'default') {
// The user hasn't been added yet, so we have to manually use this institution's lang
}
else {
}
}
We have also opened a PR in github: https:/
Changed in mahara: | |
assignee: | Cecilia Vela Gurovic (ceciliavg) → nobody |
Changed in mahara: | |
status: | Triaged → In Progress |
assignee: | nobody → Nelson (nmoller-c) |
Changed in mahara: | |
status: | In Progress → Fix Committed |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
Thank you very much for a fix for this issue, Nelson.
Cecilia, can you please pull the patch into Gerrit and ensure that Nelson remains the author?
Nelson, we don't use Github pull requests as Github is only a mirror. If you want to get future changes into the Mahara code review system directly, you can find information on how to set up the connection to Gerrit at https:/ /wiki.mahara. org/wiki/ Developer_ Area/Contributi ng_Code