Token implementation for profile is wrong

seutje - July 3, 2009 - 14:23
Project:Invite
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

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

#1

marieconbgdlr - November 18, 2009 - 01:25

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?

 
 

Drupal is a registered trademark of Dries Buytaert.