You are here

function relation_entity_collector_preprocess_username in Relation 8

Same name and namespace in other branches
  1. 8.2 relation_entity_collector/relation_entity_collector.module \relation_entity_collector_preprocess_username()
  2. 7 relation_entity_collector/relation_entity_collector.module \relation_entity_collector_preprocess_username()

Implements hook_preprocess_username().

We capture every user printed this way.

File

relation_entity_collector/relation_entity_collector.module, line 165
Relation Entity Collector Block.

Code

function relation_entity_collector_preprocess_username($variables) {
  if (_relation_entity_collector_user_has_access() && isset($variables['account']->nid)) {

    // This looks like a node passed to theme('username') in
    // template_preprocess_node() and user_node_load() doesn't load the user
    // so we do instead. It does not work with modules using render arrays
    // because it is called too late but Views renders early.
    User::load($variables['account']->uid);
  }
}