Hi,
On Sat, Sep 29, 2012 at 5:40 PM, Hadubard hadubard@gmail.com wrote:
I'd say you could simply call user_load($user->uid).
No, it eventually also calls entity_load_single("user", $user->uid);
If that doesn't do the trick have a look at field_attach_load().
Yeah, also tried that: http://api.drupal.org/api/drupal/modules%21field%21field.attach.inc/function...
"field_attach_load($entity_type, $entities, $age = FIELD_LOAD_CURRENT, $options = array())
Loads fields for the current revisions of a group of entities. Loads all fields for each entity object in a group of a single entity type. The loaded field values are added directly to the entity objects."
... but it does nothing here. And I actually can't see how this "loaded field values are added directly to the entity objects" shall happen, as you don't pass $entities as a reference. So how could the function change $entites?
Btw: I consider it bad practice to overwrite the global $user object.
Oh right, yeah, good point!