Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.8
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
26 Aug 2009 at 21:51 UTC
Updated:
24 Jun 2010 at 12:00 UTC
I have a table that contains the columns nid and uid. In hook_views_data, I only see an option for a join to contain one column. I would like the join condition LEFT JOIN my_table ON node.nid = my_table.nid AND node.uid = my_table.uid.
Is this possible? My first thoughts are somehow overriding the views_join handle, though I don't know how to do this.
Thanks!
Comments
Comment #1
dawehnerI'm not sure whether this is a good way.
You could extend the views_join class, and extend it so that you can add two join criterias(or multiple).
Then you create a new instance of your class, and let it use as views_join object.
Comment #2
venkatd commentedI have successfully extended the views_join class. However, I can't get the handler to be automatically included. I have implemented the following hook_views_handlers but it doesn't seem to work.
The view_handler_filter_boolean_null_operator is included as expected but views_join_multiple isn't. If I manually include it in hook_init of my module then it works, but that feels like a hack. Any idea on how to do it the right way?
Thanks!
Comment #3
Alun commentedHello, I know this is an old issue, but it makes more sense to bump this one, rather than start a new one..
I am getting the same problem as outlined by venkatd.
I have extended the views_join class in the same way as outlined above. The name of my handler is 'leaguesite_join_relation'
I then created a file called 'leaguesite_join_relation.inc' in the same folder and extended views_join in that file. However, it is not getting called.
Am I declaring the handler correctly or is it an issue in Views?
If its my fault, I promise to write up some documentation on how to do this for others, as a way of repaying for your time.
Thanks!
Alun
Comment #4
Alun commentedComment #5
Alun commentedJust found this comment from merlin, I'll follow these instructions.
http://drupal.org/node/540128#comment-1889104