Notification for user added to institution is not in the recipient's language

Bug #1538225 reported by Jan Behrens
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon

Bug Description

When a user is added to an institution using the "Add members" button on the "Institution members" page, the notification sent to the user is in the language that the admin/staff, i.e. the one who added the user, currently uses.

Example: Admin's language is English, user's language is German. Admin adds the user to an institution by selecting him/her from either the "Users who have requested membership" list or the "Non-members" list and clicking on "Add members". User receives the notification in English:
"Institution membership confirmation
You have been added as a member of Test Institution."

When the admin's language is changed, the notification in sent in the respective language.

The notification must be in the recipient's language, regardless of the admin's or staff's language.

Mahara version: 15.10.1
Chromium browser v48, Linux, Postgres

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/5970

Revision history for this message
Robert Lyon (robertl-9) wrote :

Hi Jan,

From what I can tell from looking at the code is that the language for the email messages sent out is based on three possible values:
- What language the Mahara site is set to
- What language the Institution is set to
- What language the user has as their language preference

When a user is added to an institution the code first checks what the institution's language is set to and if it set to 'site default' then it will be based on what the site's language is set to.

So what is missing from this scenario is the user's language preference, if set, is being ignored.

I've added a patch for review to deal with this situation https://reviews.mahara.org/#/c/5970/

Cheers

Robert

I've added a patch to make that the first choice of what language the email is sent in.

Changed in mahara:
milestone: none → 16.04.0
assignee: nobody → Robert Lyon (robertl-9)
importance: Undecided → Medium
status: New → In Progress
importance: Medium → High
Revision history for this message
Jan Behrens (jb3) wrote :

Hi Robert,

thank you! The patch works for me.

Jan

Revision history for this message
Charlie Amoah (charlie-catalyst) wrote :

== How to test ==

1. Access gerrit and pull the latest patch for the fix

2. Log in as Admin

3. Navigate to http://langpacks.mahara.org/

4. Right click on the language of choice (for example: de-master.tar.gz) and select "Save Link As" to save the zipped file into your download folder

5. Do Ctrl+Shift+Y to open the folder with the downloaded zipped file

6. Right click on the folder then select "Open Containing Folder"

7. The "Downloads" folder should open up displaying the the zipped file

8. Right click on the zipped file then select "Extract Here"

9. The filed should now be unzipped

10. Right click on the unzipped file then select "Copy"

11. Navigate to Home > maharadata > master > langpacks > right click > paste

12. The new language should show up

13. Navigate to the settings page of your mahara instance and refresh the page

14. The new language should show up in the "Language dropdown" section of the settings page

15 If not created already create an institution and change its language of your choosing and save the page.

16. If not created already create a user and add the user to the new institution

17. Log in as the new user when prompted regarding password click on the green text "log in anyway"

18. Go to the settings page for the user, change their language, change their language
 option then save the page

19. Refresh the page to show the page displaying the new language

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Test scenario for the original bug report:

1. Install at least two language packs.

2. Create a user in "No institution" and log in as that user and change the language preferences to language 1 and make sure that the interface is displayed in that language.

3. Create an institution and set the language preference to language 2 and create another user as member of that institution to check that the interface is in that language.

4. Add the user from step 2 to the new institution.

5. Log in as the user and check his inbox. The institution confirmation message should be displayed in the user's preferred language and not the institution language.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5970
Committed: https://git.mahara.org/mahara/mahara/commit/2a0fd12bba2d7c622eaecd6930884d0f44dfb31d
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit 2a0fd12bba2d7c622eaecd6930884d0f44dfb31d
Author: Robert Lyon <email address hidden>
Date: Wed Jan 27 15:20:40 2016 +1300

Bug 1538225: Respect user's lang preference when adding to institution

Currently the notification message is sent out in the language of the
institution one is joining if that institution has language set. But
if the user being added to the institution has a language preference
set then it should be respected.

behatnotneeded - involves emails

Change-Id: I3e42b08d30c69832e5dcd2e7c5eed835bdb26154
Signed-off-by: Robert Lyon <email address hidden>

Aaron Wells (u-aaronw)
Changed in mahara:
status: In Progress → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.