In adding Views integration to my module, I ran across one error in the views.api.php file.

The example of relationship parameters declaration in hook_views_data_alter is misleading: it suggest to use the the attribute "field" instead of "relationship field" to describe the "Real field name on the 'foo' table":

['foo']['dummy_name'] = array(
'title' => t('Example relationship'),
'help' => t('Example help'),
'relationship' => array(
'base' => 'example_table', // Table we're joining to.
'base field' => 'eid', // Field on the joined table.
'field' => 'fid', // Real field name on the 'foo' table.
'handler' => 'views_handler_relationship',
'label' => t('Default label for relationship'),
'title' => t('Title seen when adding relationship'),
'help' => t('More information about relationship.'),


gabriel.achille’s picture

Assigned:gabriel.achille» Unassigned
Status:Active» Needs work
new631 bytes

and the proposed patch.
It is not much but it could save time to developer !