Commit d6ef5bd2 authored by Steve Gerbino's avatar Steve Gerbino

Issue #1220506 by Dave Reid: Applied patch by Dave Reid to correct an

issue of duplicate user tokens.
parent 80664fa9
......@@ -106,7 +106,7 @@ function realname_registration_tokens($type, $tokens, array $data = array(), arr
$replacements[$original] = !empty($account->$field_firstname) ? drupal_substr($account->{$field_firstname}['und']['0']['value'], 0, 1) : '';
}
break;
case 'middle-initial':
if (variable_get('realname_registration_use_profile2_middlename_field')) {
$result = db_query('SELECT p.pid FROM {profile} AS p WHERE p.uid = :uid AND p.type = :type', array(':uid' => $account->uid, ':type' => $field_middlename_profile_type));
......@@ -137,9 +137,5 @@ function realname_registration_tokens($type, $tokens, array $data = array(), arr
}
}
if ($type == 'current-user') {
$account = user_load($GLOBALS['user']->uid);
$replacements += token_generate('user', $tokens, array('user' => $account), $options);
}
return $replacements;
}
\ No newline at end of file
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment