Hi ,
first just to say it's nice module, I use it for views data and some trouble happens :
first it's not the

 hook_views_data(&$data)

to implementate but


 hook_views_data()

and your need to return $data.
Second the link "add relation" seem to be not work, sor In generate code it miss the relationship on field like

     'relationship' => array(
          'base' => 'users', // The name of the table to join with.
          'base field' => 'uid', // The name of the field on the joined table.
          // 'field' => 'nid' -- see hook_views_data_alter(); not needed here.
          'handler' => 'views_handler_relationship',
          'label' => t('Default label for the relationship'),
          'title' => t('Title shown when adding the relationship'),
          'help' => t('More information on this relationship'),
      ),

when you wanna make relation with another table

Comments

sukr_s’s picture

Status: Active » Postponed (maintainer needs more info)

1. we use the &$data approach so that each table can be in function of it's own rather than one large hook_views_data. this make the code more readable. so you'll need to add the hook_view_data and call the generated function e.g.

<?php
/**
  * Implements hook_views_data().
  * call the generated function here.
 */
function mymodule_views_data() {
  $data = array();
  _mymodule_mytable_views_data($data);
  return $data;
}

/**
 * This is the generated function
 */
function _mymodule_mytable_views_data(&$data) {
  $data[]
}
?>

2. for the add relation link, colorbox need to be enabled and the colorbox setting for inline must also be enabled. planning to clean this up. but will have to wait.
w.r.t. relation field, i don't get the issue. i've used it in several projects. never faced an issue.