Closed (fixed)
Project:
Registration codes
Version:
6.x-1.4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Dec 2009 at 07:40 UTC
Updated:
11 Jan 2010 at 13:20 UTC
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 commentedThanks for tracking down the problem, I've fixed this now in the development release.