Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.7.6, 3.8.4, 3.9.1, 3.10.4, 3.11, 4.0
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
-
MOODLE_400_STABLE
-
master_
MDL-69194-core_user_update_users -
Description
WS function core_user_update_users() fails to update a user's email attribute when the new email is already assigned to another user. I understand this is the default behaviour for a brand new Moodle instance, but the problem is, it doesn't return any error message or exception. I can successfully update other attributes such as firstname and password, so I believe it's not an issue with permissions or my programming.
Steps to reproduce:
1) Create user1 with email foo@bar.com;
2) Create user2 with email pee@wee.com;
3) Enable web services and configure a third user with proper permissions (problem occurs even if this user is a site administrator);
4) Call WS function core_user_update_users() to change user2's email to foo@bar.com.
What I expected:
User2's email is not changed and WS call returns an error like "duplicate email" or "invalid parameter".
What actually happens:
User2's email is not changed and WS call returns nothing.