-
Bug
-
Resolution: Fixed
-
Critical
-
2.7.1, 2.8
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
MOODLE_27_STABLE
-
wip-
MDL-46589-master -
- Upload new users using CSV file, choose to generate and send out passwords
- Run cron
- Make sure emails are sent out
After importing users from a CSV file, the whole process completes, but when the scheduled cron script tries to send emails to users it returns an error for this partial task:
Notice: Undefined property: stdClass::$auth in xxx/lib/moodlelib.php on line 4731
|
Scheduled task failed: Send new user passwords,Authentication plugin {$a} not found.
|
We tested different versions and found:
$release = '2.7+ (Build: 20140626)'; - still working
$release = '2.7+ (Build: 20140703)'; - ends with error
The problem is caused by a missing authentication value in the user object, which is required in file moodlelib.php by function update_internal_user_password() on line 4731
$authplugin = get_auth_plugin($user->auth);
|
Between versions two versions tested there are changes in the function setnew_password_and_mail() and the issue is related to this.
As a hotfix of this issue we changed the function send_new_user_passwords_task function execute(), in the following line:
$newusers = $DB->get_recordset_sql("SELECT u.id as id, u.email,
|
...to which we added the new attribute u.auth...
$newusers = $DB->get_recordset_sql("SELECT u.id as id, u.email, u.auth,
|
It provides authentication method to following actions and fixes issue.
- is a regression caused by
-
MDL-45641 Trigger user updated event only after the profile fields are updated
- Closed
- is duplicated by
-
MDL-46393 External Database enrollment no longer sending email to new users
- Closed
-
MDL-46901 In M2.7.1, User won't received change password email after the Bulk users actions- With selected user "force password change"
- Closed
-
MDL-46743 Task "send new user password" not working
- Closed
-
MDL-46420 send new user passwords task fails
- Closed
-
MDL-46807 Welcome email not sent when users created by CSV upload
- Closed
-
MDL-46879 New user password notifications not being sent
- Closed