Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
fieldapi data
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Jan 2011 at 15:25 UTC
Updated:
18 Mar 2011 at 08:11 UTC
I just committed #962694-42: [release blocker] Make Node Reference Relationships Work in Views, that adds relationships for the node_reference and user_reference field types.
Works fine for base properties (node title...), but currently Field API fields added through a noderef relationship do not get displayed.
views_handler_field_field::query() always sets $this->field_alias to 'nid', so the nid of the referenced node isn't seen as a nid to load in pre_render().
views_handler_field_field::query() has this code :
if (!empty($this->relationship)) {
foreach ($this->view->relationship as $relationship) {
if ($relationship->alias == $this->relationship) {
$base_table = $relationship->definition['base'];
$base_field = $relationship->definition['base field'];
}
}
}
...
$this->field_alias = $this->query->add_field($base_table, $base_field, '', $params);
and the definition of the relationship in node_reference_field_views_data() has :
'base' => 'node',
'base field' => 'nid',
I'm not sure which code is at fault ;-)
Comments
Comment #1
zwhalen commentedI seem to have the same problem, though with -alpha1 release. And in my case, the relationship comes from Feeds module (Feeds item: Owner feed).
Comment #2
BarisW commentedSubscribing
Comment #3
martijn houtman commentedSubscribing.
Comment #4
John Carbone commentedSubscribing.
Comment #5
nanpss commentedSubscribing
Comment #6
_vl_ commentedSubscribing
Comment #7
kinesin commentedSubscribing
Comment #8
les limAre you sure you're working against dev? Field API fields through referenced nodes are working fine for me.
I'm pretty sure this was resolved here:
http://drupalcode.org/viewvc/drupal/contributions/modules/views/modules/...
Comment #9
yched commentedDoh - I was indeed checking the wrong branch. Looks like I still need to wrap my head around drush / git.drupal.org integration...
This does work in latest 7.x-3.x.
Comment #10
rogueturnip commentedsubscribing
Comment #11
kbobash commentedSubscribing
Comment #12
zwhalen commented#9 is correct. Latest version fixed this issue for me.
Comment #13
klonosClosed indeed, but not a dupe though ...just clearing things out so that people don't wonder of which issue this is a dupe.
Comment #14
videographics commentedI think this may be related. I was having the problem where the Field API fields weren't showing up at all. Going from alpha to dev fixed that for me but now I get this...
Notice: Undefined index: additional fields in date_field_views_data_alter() (line 252 of /sites/all/modules/date/date_views/date_views.module).
Warning: array_merge() [function.array-merge]: Argument #1 is not an array in date_field_views_data_alter() (line 252 of /sites/all/modules/date/date_views/date_views.module).
.
.
.
Is it possible that dates (with their multiple values) are not being handled properly by views or is this an issue with the date module?
Comment #15
dawehnerThis problem was already reported against the date module: #1032942: Undefined index #date_format in date_popup_process_date()/date_popup_date_granularity()/, date_popup.module
It's the right place to do this.