Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.8.8, 2.9.2, 3.0
-
MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
-
MOODLE_28_STABLE, MOODLE_29_STABLE
-
MDL-51685-master -
Hide
- As admin, enable "Mobile services": Plugins ► Web Services ► Mobile
- Create a course, enrol a couple of students.
- Upload a profile image for one of the users
- Create a Token for one of the students:
- Click on Site administration ► Plugins ► Web services ► Manage tokens
- Next, you can do a CURL REST call simulating a WS client. We'll test that the core_enrol_get_enrolled_users WS now returns the images as it should:
- You need to replace the wstoken, courseid and the URL of your moodle instance
curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_enrol_get_enrolled_users&courseid=2&wstoken=c55d18a80fe8c06754a8b9f411087458' | python -m "json.tool"
- You need to replace the wstoken, courseid and the URL of your moodle instance
- Confirm that you receive the list of users and the field containing the users pictures points correctly to the right images. The user with profile image should have a profileimageurl like: http://localhost/m/stable_master/pluginfile.php/25/user/icon/clean/f1?rev=15.
- Now, we'll test retrieve a single user profile with core_user_get_course_user_profiles.
- You need to replace the wstoken, courseid, userid and the URL of your moodle instance. Use the userid that has the uploaded profile image.
curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_user_get_course_user_profiles&userlist%5B0%5D%5Buserid%5D=4&userlist%5B0%5D%5Bcourseid%5D=2&wstoken=5b6154a56566a194f60f7f395f235179' | python -m "json.tool"
- You need to replace the wstoken, courseid, userid and the URL of your moodle instance. Use the userid that has the uploaded profile image.
- Confirm that the image urls returned have the 'rev' param.
- Now enable Gravatar images in the Moodle site.
- Run the same CURL commands, for the users without profile image you will see that the userpictureurl points now to a gravatar URL.
ShowAs admin, enable "Mobile services": Plugins ► Web Services ► Mobile Create a course, enrol a couple of students. Upload a profile image for one of the users Create a Token for one of the students: Click on Site administration ► Plugins ► Web services ► Manage tokens Next, you can do a CURL REST call simulating a WS client. We'll test that the core_enrol_get_enrolled_users WS now returns the images as it should: You need to replace the wstoken, courseid and the URL of your moodle instance curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_enrol_get_enrolled_users&courseid=2&wstoken=c55d18a80fe8c06754a8b9f411087458' | python -m "json.tool" Confirm that you receive the list of users and the field containing the users pictures points correctly to the right images. The user with profile image should have a profileimageurl like: http://localhost/m/stable_master/pluginfile.php/25/user/icon/clean/f1?rev=15 . Now, we'll test retrieve a single user profile with core_user_get_course_user_profiles . You need to replace the wstoken, courseid, userid and the URL of your moodle instance. Use the userid that has the uploaded profile image. curl 'http://localhost/m/stable_master/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=core_user_get_course_user_profiles&userlist%5B0%5D%5Buserid%5D=4&userlist%5B0%5D%5Bcourseid%5D=2&wstoken=5b6154a56566a194f60f7f395f235179' | python -m "json.tool" Confirm that the image urls returned have the 'rev' param. Now enable Gravatar images in the Moodle site. Run the same CURL commands, for the users without profile image you will see that the userpictureurl points now to a gravatar URL.
Description
When we fixed MDL-49823 we forgot to fix the core library that return user images