I am trying to access my profile2 fields in template.php. I get profiledata, but I also get an error message:
EntityMalformedException: Missing type profile2. in entity_extract_ids() (row 7663 of /includes/common.inc).
Should not the entity type in field_get_items()
be 'profile2'
, or is it another value?
$profiledata = profile2_load_by_user($variables['comment']->uid);
$lastname = field_get_items('profile2', $profiledata, 'field_lastname');