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
  }
}
CommentFileSizeAuthor
#2 user_karma_registration.patch504 bytesneochief

Comments

Ainur’s picture

p.s. currently user receives karma ONLY after an update of own profile.

neochief’s picture

StatusFileSize
new504 bytes
mercmobily’s picture

Status: Needs review » Fixed

Hi,

Fixed!
Thanks a billion... :D

Merc.

mercmobily’s picture

Status: Fixed » Closed (fixed)