| Project: | Referenced By Views Filter |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
If an attaching node has no attached nodes, noderefence places a row in the field table anyway, with a field value of 0, like this:
(attaching node nid and vid), 0However, my situation is a large node import of attaching nodes, which didn't place these rows.
It's also feasible (though I haven't tested this) that if the CCK field is created after several nodes already exist, that these will not get their zero valued rows.
This module doesn't handle this case properly: the ReferencedByFilter argument has no effect, and the view returns all rows as if the argument were not there.
The problem is these lines:
$node = node_load($nid);
if (!empty($node->$referencing_field)) {If the $node doesn't have the field, it's completely skipped!
The fix is to remove this condition and execute the code in the if block.
I suppose this might be by design, so passing a node id for a node that doesn't have this field returns the whole view. I'm not sure when you'd want that though.