-
Bug
-
Resolution: Duplicate
-
Critical
-
None
-
2.6.1, 2.7.3, 2.8.1
-
MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE
NOTE: This only affects the deletion of users where the email field is empty - e.g. in cases where the account was created via an import.
Line 109 of user/lib.php
if ($user->username !== core_text::strtolower($user->username)
The code above is comparing values AND types.
When I get the error with 'usernamelowercase' it isn't because the strings don't match, its because $user->username is a double and the value returned by core_text::strtolower($user->username) is a string.
There are many possible fixes for this
1) remove an equals sign from line 109 of user/lib.php
if ($user->username != core_text::strtolower($user->username)
2) force a string value on the username on line 109 of user/lib.php
if (strval($user->username) !== core_text::strtolower($user->username)
3) force a string value on the username on line 4249 of moodlelib.php
$updateuser->username = strval($delname);
- duplicates
-
MDL-42884 Can not delete users with invalid emails
-
- Closed
-