Hook and rule get the new email address twice and not the old email address. I've made a small change in the `email_confirm_user_change_mail` function right before the user_save call (around lines 254 - 258):

$old_mail = $account->mail;
user_save($account, array('mail' => $new_mail, 'login' => REQUEST_TIME, 'email_confirmed' => TRUE));
module_invoke_all('email_confirm', 'email confirmation', $account->uid, $old_mail, $new_mail);
if (module_exists('rules')) {
  rules_invoke_event('email_confirm_email_change_confirmation', $account, $old_mail, $new_mail);
}

Comments

MarcElbichon’s picture

Priority: Normal » Major

+1
Changed to major.

jaydub’s picture

Status: Active » Needs review

Looks like the user_save() is updating the $account object which makes sense. I've pushed the fix in git. If I could get one of you to test out the changes with current email_confirm code in git or by downloading a -dev tarball (once it's been updated) to verify that would be great. If the fix works as it should I'll make a new release.

MarcElbichon’s picture

Test with success.
Thanks

jaydub’s picture

Status: Needs review » Closed (fixed)