I have a "legacy" table I need to join to a custom content type. I
have already joined this table to {users} with no problem, but I
cannot join this to {node}. I tried specifying the cck table, but
without luck, after adding a field of my legacy table, views preview
returns an ajax error.
Any hint? thanks
$data['tb_afiliats']['table']['join'] = array(
'users' => array(
'left_table' => 'alt_login',
'left_field' => 'alt_login',
'field' => 'afiliat_dni', //legacy field
),
'node' => array(
// 'left_table' => 'content_field_nif',
'left_field' => 'field_nif_value',
'field' => 'afiliat_dni', //legacy field
),
);
Comments
Comment #1
enboig commentedAfter some testing I found Views isn't joining the table:
Is there any problem in my table definition?
Comment #2
dawehnerIs 'afiliat_dni' a field of the table tb_afiliats?
This field should have this.
Comment #3
enboig commentedyes, it is.
Comment #4
enboig commentedThe problem continues:
The generated query is:
The reason table pef_content_field_nif appears is because I requested "node_data_field_nif.field_nif_value" field; if I don't the table don't appear.
Any hint? Maybe I should join my table to another table so CCK takes it?
Comment #5
R.Hendel commentedHi, is this request still active? In the meantime views has continued so much further.
I would fix this to clean queue.
Please feel free to reopen it, if you can provide more information.
Otherwise it would be closed automatically after two weeks.
Comment #6
enboig commentedI used hook_views to define the tables in a module and I coded everything manually; but in further cases it would be usefull to have it solved.