Postponed (maintainer needs more info)
Project:
Code generator
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
4 Dec 2012 at 18:18 UTC
Updated:
12 Apr 2013 at 04:31 UTC
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
Comment #1
sukr_s commented1. 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.
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.