In Drupal 6, I've created a custom View type that allows me to query data in my custom table. One of my fields, uid, relates to drupal users. In the Views I create for my custom type, I can display user info for each record by using a simple join in hook_views_data():
$data['users']['table']['join']['awesome_user_submissions'] = array(
'left_field' => 'uid',
'field' => 'uid',
);
Now, I'd also like to display Profile fields in my view (eg: profile_first_name). Unfortunately, it doesn't appear that this will be a simple table join. How can I do this?
Solution: (thanks @googletorp)
Don't use the join I originally used (above). Instead replace it with the following in hook_views_data(), then I can use fields from the 'users' table, as well as from the 'profile_' tables.
$data['awesome_user_submissions']['uid'] = array(
'title' => t('User'),
'help' => t('Relate an awesome submission to the user who entered it.'),
'relationship' => array(
'handler' => 'views_handler_relationship',
'base' => 'users',
'base field' => 'uid',
'label' => t('user'),
),
);