We need some additional views fields for our activity views. Namely, we should be able to display the user name and user picture as fields just as nodes can. 'uid' is a column within {activity_messages} so this should be fairly easy to replicate looking at how it is implemented for node.

Should be able to use views_data_alter() to just throw in the relationship or users and get all of them in one go.

Comments

sirkitree’s picture

Status: Active » Needs review

Well, that was simpler than I thought -

/**
 * Implementation of hook_views_data_alter() to add items from the users table.
 */
function activity_views_data_alter(&$data) {
  $data['users']['table']['join']['activity_messages'] = array(
    'left_table' => 'activity_messages',
    'left_field' => 'uid',
    'field' => 'uid',
  );
}
sirkitree’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.