summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaren Stevenson2008-03-21 12:56:51 (GMT)
committer Karen Stevenson2008-03-21 12:56:51 (GMT)
commit330807d01878a05896d9292a8ca67c8f7b0286e3 (patch)
tree4389c0c367e23194d75130d8147854dc7b57b1d7
parent7261cf74641653292b4b149d8941fb6e80bc4137 (diff)
#237085 Getting Views 2 relationships working! Patch by merlinofchaos.
-rw-r--r--nodereference.module3
-rw-r--r--userreference.module13
2 files changed, 14 insertions, 2 deletions
diff --git a/nodereference.module b/nodereference.module
index f95e349..dec2094 100644
--- a/nodereference.module
+++ b/nodereference.module
@@ -152,10 +152,9 @@ function nodereference_field_settings($op, $field) {
$table_alias = 'node_data_'. $field['field_name'];
$data[$table_alias][$field['field_name']]['relationship'] = array(
+ 'base' => 'node',
'field' => $db_info['columns']['nid']['column'],
- 'tablename' => $db_info['table'],
'handler' => 'views_handler_relationship',
- 'content_field_name' => $field['field_name'],
);
return $data;
}
diff --git a/userreference.module b/userreference.module
index 439510a..ff2b635 100644
--- a/userreference.module
+++ b/userreference.module
@@ -99,6 +99,19 @@ function userreference_field_settings($op, $field) {
'extra' => array('field' => $field),
),
);
+
+ case 'views data':
+ $data = content_views_field_views_data($field);
+ $db_info = content_database_info($field);
+ $table_alias = 'node_data_'. $field['field_name'];
+
+ $data[$table_alias][$field['field_name']]['relationship'] = array(
+ 'base' => 'users',
+ 'field' => $db_info['columns']['uid']['column'],
+ 'handler' => 'views_handler_relationship',
+ );
+ return $data;
+
}
}