Hi,
I'm trying to use the table wizard, but can't seem to get the relationships to work.
I'm using:
Drupal 6.15
Views 2.11
Schema 1.x-dev (also tried with 1.7)
Table wizard 1.x-dev (also tried with 1.2)
Situation:
I have imported tables from a D5 to the database (used a prefix for all the tables). Now I want to link these tables together so that I get all data for a specific content type in one view, so I add a relationship between to tables (both on the nid field). Then I go back to the view of the base table and edit it, but the relationship is not added. Also tried a manual relationship but the relationship is not available. I don't get any errors, also tried if I got more data back when I disabled javascript for views but no warnings or anything else showed up.
Also tried it on a clean drupal installation (drupal 6.17), trying to create a relationship between 2 tables that are not already in views (eg. locales_source and locales_target). But I get the same result
Can anyone reproduce this?
Or does anybody know what the problem is?
Thanks
Comment | File | Size | Author |
---|---|---|---|
#4 | tw_tablebuild.patch | 534 bytes | stijn.vanden.brande |
Comments
Comment #1
stijn.vanden.brande CreditAttribution: stijn.vanden.brande commentedHi,
after some debugging I discovered what was going wrong. I compared the arrays for the join data and found that there were some differences between what standard views generates and what TW generates. If you look at function '_tw_generate_views_relationship_data' in file 'tw_tablebuild.inc' for automatic relationships, the following array will be build up:
When comparing this to what standard views returns I adjusted the array to:
and the relationships work. The relationships does not show up in the view edit form, but I can add the fields of the other table without any problems.
This is only for 'automatic' relationships, will look at the 'manual' relationships later and post it here too.
Greets,
Stijn
Comment #2
datawench CreditAttribution: datawench commentedWhere exactly did you make this adjustment? Where did you save your modified version of this join description?
Comment #3
stijn.vanden.brande CreditAttribution: stijn.vanden.brande commentedHi,
I made the adjustment in file 'tw_tablebuild.inc' line 176 and below.
I'll try to create a patch for this today and then attach it here.
Greets,
Stijn
Comment #4
stijn.vanden.brande CreditAttribution: stijn.vanden.brande commentedOkay, got the patch.
It's a day later, but its here.
If you need any more help trying to figure this out let me know.
Greets,
Stijn
Comment #5
datawench CreditAttribution: datawench commentedMany thanks. This contributes a lot to my understanding of what's going on under the hood here.
Comment #6
soulfroysSubscribe
Comment #7
soulfroysSubscribe