global $user;
$user->uid ;
print_r($user->uid);
print "print out the user value" . $user->uid;
$uid =3;
$account = user_load($user->uid);
$profile = profile2_load_by_user($account);
$print_first_name = drupal_render(field_view_field('profile2',$profile['main_profile'], 'field_first_name'));
print $print_first_name;
What I have attempted to do is to pass the $user->uid
to the user_load
function.
When I pass $uid = 3
to the user_load
function it seems to work fine. I am wondering what approach I should try to fix this problem.
error message:
EntityMalformedException: Missing bundle property on entity of type profile2. in entity_extract_ids() (line 7562 of /home/td6/public_html//includes/common.inc).