Download & Extend

Token implementation for profile is wrong

Project:Invite
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (won't fix)

Issue Summary

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:

<?php
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

#1

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?

#2

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.

#3

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.

nobody click here