Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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":
$data['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.'),
),
);
Comment | File | Size | Author |
---|---|---|---|
#1 | views-documentation-views.api_.php-2118107-1.patch | 631 bytes | gabriel.achille |
Comments
Comment #1
gabriel.achille CreditAttribution: gabriel.achille commentedand the proposed patch.
It is not much but it could save time to developer !