EntityDrupalWrapper->value() causes infinite recursion on user login? I have a few instances on my site where I perform actions on User Login.

I create an EntityMetadataWrapper like so:

global $user;
$uw = entity_metadata_wrapper('user', $user);


And then I go to retrieve values like this:

$special_value = $uw-&gt;field_special_value-&gt;value()


For some reason, this particular line will cause an infinite recursion and crash my site.

Does anyone know what I'm doing wrong here? I am calling one of these from a Rules event and another one from hook_user_login, but it seems like no matter what, I get this recursive error.

This ONLY seems to happen in hook_user_login, all of my other value() calls to Entity Metadata Wrappers seem to work fine.

Note; these are both Entity References -- one references a Taxonomy Term and the other references a custom Entity.
are you sure the user is logged in and you have a full $user object available in your rule?

Maybe you have to call $user = user_load($uid, TRUE); explicity for this 1 case?