in _invite_token_types it uses the global $user, which doesn't have the profile fields in it

easy fix is to reload the user object by putting this right after the global $user in _invite_token_types:

if ($user->uid) {
  $user = user_load(array('uid' =>$user->uid));
}

that was the $user->profile_fieldname will be populated and profile tokens will work, given that http://drupal.org/node/125640#comment-1590814 is applied

Comments

marieconbgdlr’s picture

Hi there,

I have applied the patch http://drupal.org/node/125640#comment-1590814 and added the code you mentioned. But i'm getting "Array" whenever i use the profile token in the email body.

How can i fix this issue?

uptil4music’s picture

Priority: Normal » Critical

Same as marieconbgdlr, getting "Array" at every profile token.

Without the ability to identify invitor by name from profile (as opposed to username or email), invitations would be easily overlooked by invitee or even reported as spam.

Changing priority to critical.

smk-ka’s picture

Status: Active » Closed (won't fix)

Just tested with the module posted in comment #70 at #125640-70: Profile tokens and it seems to work fine out of the box.