If I create view of taxonomy type and load all nodes that are tagged with particular tag and then add fields to show nodes that refer to oned relationship filters there is 0 results or field is empty.

Comments

henrijs.seso’s picture

marking this as duplicate, but its actually another report of same bug. #848196: Show other nodes that also refer to a node

using latest -dev and views2

henrijs.seso’s picture

function referrers($nid, $fields, $types = NULL) has no $nid set if using relationships in file nodereferrer_view_handler_field.inc

henrijs.seso’s picture

this function function render($values) receives nid if view type is node (works) and uid if user and tid if taxonomy (fails), actually it should receive nid in all cases because it should receive node nids from relationships :(

at least i think so... im not really php expert

andypost’s picture

interesting bug

henrijs.seso’s picture

this solution works but it is uber ugly and probably totally in wrong place :) someone smarter needed to fix this...

in function render($values) found in file nodereferrer_view_handler_field.inc this line

<?php
  $list = $this->get_item_list($values->nid);
?>

if replaced by this code

<?php
    if(isset($values->nid)){
      $list = $this->get_item_list($values->nid);
    }
    else{
      $list = $this->get_item_list($values->node_term_node_nid);
    }
?>

works.

As far as I understand, NodeReferrer field does not receive properly formated info from argument and fail in all kinds of views except for 'node'. Help needed with this...

some more information, maybe useful

displaying items of type Node - value of $values (WORKS)

... (Object) stdClass
      nid (String, 3 characters ) 191

displaying items of type User - value of $values (FAILS)

... (Object) stdClass
      uid (String, 1 characters ) 6
      users_name (String, 8 characters ) managest
      node_term_node_title (String, 9 characters ) Demo task
      node_term_node_nid (String, 3 characters ) 191

displaying items of type Term - value of $values (FAILS)

... (Object) stdClass
      tid (String, 2 characters ) 12
      term_data_name (String, 14 characters ) Estonia office
      term_data_vid (String, 1 characters ) 2
      node_term_node_title (String, 9 characters ) Demo task
      node_term_node_nid (String, 3 characters ) 191
andypost’s picture

Seems reasonable, could you provide a steps to reproduce this?

Suppose we need to test this with more then one relation used, I think node_term_node_nid name could be changed and value should be found somewhere else