I'm using Location module (particularly its Location CCK part) with Drupal 7. Added location field 'field_location' to User (as an example of hosting entity), and initialized location values for test users in user edit interface. However, I'm unable to access location data of the current user:
global $user; $user_id = $user->uid; $loc = $user->field_location;
$wrapper = entity_metadata_wrapper('user', $user_id); $loc = $wrapper->field_location;
The statements with $loc don't work for object and wrapper (while both user object and wrapper are initialized successfully). Same for:
$loc = $wrapper->field_location; $loc = $wrapper->field_location->raw();
I've read a number of posts on this topic, however haven't found a workable solution, would appreciate insights on this.