MDL-45641 event: Manually trigger event where needed.
Some places, user_created_user and user_updated_user events should be triggred after profile data is saved.
This commit is contained in:
+4
-1
@@ -220,7 +220,7 @@ if ($usernew = $userform->get_data()) {
|
||||
}
|
||||
|
||||
// Update user with new profile data.
|
||||
user_update_user($usernew, false);
|
||||
user_update_user($usernew, false, false);
|
||||
|
||||
// Update preferences.
|
||||
useredit_update_user_preference($usernew);
|
||||
@@ -244,6 +244,9 @@ if ($usernew = $userform->get_data()) {
|
||||
// Save custom profile fields data.
|
||||
profile_save_data($usernew);
|
||||
|
||||
// Trigger event.
|
||||
\core\event\user_updated::create_from_userid($user->id)->trigger();
|
||||
|
||||
// If email was changed and confirmation is required, send confirmation email now to the new address.
|
||||
if ($emailchanged && $CFG->emailchangeconfirmation) {
|
||||
$tempuser = $DB->get_record('user', array('id' => $user->id), '*', MUST_EXIST);
|
||||
|
||||
Reference in New Issue
Block a user