Some of user don't get any role assigned on register, I think it's due to karma is being assign on 'after_update' (user_karma.module line 697).
I think we should add on insert event in order to correctly assign karma.
Here is my user_karma_user function:
/**
* Implementation of hook_user().
* This will make sure that the user is assigned the right role
* as soon as s/he signs up.
*/
function user_karma_user($op, &$edit, &$account, $category = NULL) {
switch ($op) {
// Assign a reole on register
case 'insert':
user_karma_calculate_role($account->uid);
break;
// Recalculate the role after an update
case 'after_update':
user_karma_calculate_role($account->uid);
break;
case 'view':
return user_karma_view_profile($account);
break;
case 'load':
if(variable_get('user_karma_load_rank_in_profile', FALSE) ){
$account->rank=user_karma_user_rank($account->uid);
}
if(variable_get('user_karma_load_karma_in_profile', FALSE) ){
$account->karma=user_karma_user_karma($account->uid);
}
break;
# END OF SWITCH
}
}
Comments
Comment #1
Ainur commentedp.s. currently user receives karma ONLY after an update of own profile.
Comment #2
neochief commentedComment #3
mercmobily commentedHi,
Fixed!
Thanks a billion... :D
Merc.
Comment #4
mercmobily commented