Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Line 178 of regcode.module in regcode_user() is $edit = module_invoke_all('regcode_used', $edit, $account, $regcode);
.
But only regcode_roles.module realizes hook_regcode_used. If this module is deactivated, module_invoke_all() returns array() and clears $edit. Also this code line is included in regcode_voucher.module.
This creates some problems. $edit is actively used in user_save() function ($edit = &$array in user_save()). Therefore, for example, user_load(array('uid' => $array['uid']))
returns anonymous user account.
To fix the bug, change the code line to
$new_edit = module_invoke_all('regcode_used', $edit, $account, $regcode);
if(!empty($new_edit)) {
$edit = $new_edit;
}
P.S. Sorry for my english.
Comments
Comment #1
aidanlis CreditAttribution: aidanlis commentedThanks for tracking down the problem, I've fixed this now in the development release.