Using NodeReferrer to show nodes that are NOT being referenced

mmilo - April 8, 2009 - 03:08
Project:NodeReferrer
Version:6.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hallo,

Let's say I have two content types - "Apple" and "Bear".

Apple contains node references to multiple Bears, and I've put a referrer back to Apple inside Bear. I'd like to be able to have a view that displays all Bears that are _not_ being referenced to by Apple.

It seems simple enough, but I can't get the view to work. Based on my understanding I *don't* need any arguments, but I've tried regardless and haven't gotten it to work. Regardless, I always get a view with all the Bears.

I've added the filter "Node: Nodereferrer: by node type", Operator "Do not return...", and placed the NID of the one Apple content that I have (although since this is by node type, I shouldn't have to?).

I've also tried adding "Node: Nodereferrer: by node type" as an argument, and provided a Default Argument of the NID, but that doesn't seem to work either.

Am I missing something?

#1

mmilo - April 8, 2009 - 04:57

I'm not sure, but I think the query is being written incorrectly for this? I get the proper results with the attached patch.

Note: I wrote the patch really quickly, and I'm not sure if it's even right. Also, there are two queries in the code, which are the same conceptually except that one returns nodes that refer to translations of the given node. I've only patched the non-translated query.

AttachmentSize
nodereferrer.patch 1.17 KB

#2

tpainton - July 21, 2009 - 11:34

I'm trying to do the same thing. I need a view of nodes that are NOT referenced by another node type. I have the latest dev running. Does it include this patch? Can someone walk this one through? thanks.

#3

andypost - July 23, 2009 - 16:47

Not this patch is never tested but waiting for reviews

#4

tpainton - July 27, 2009 - 02:42

The nodereferrer content filters seem to accomplish what is already possible using Views 2.

"return Nodes that refer to" and "return nodes that do not refer to" can be done using filters and arguments.. right?

Can't we just throw the referring node id in as an argument? Then, using Relationships we can filter all referenced nodes from Content:field_A(argument)? Where field_A is a node reference. And argument is the node id of the refering node. Likewise, using the NOT we can return nodes that don't reference a certain node. I have not tried this but it seems logically like it would work.

What is needed is a filter that lists nodes that don't carry a certain node in their node referrer field. THEN we can list nodes that are NOT referenced by another node..

#5

tpainton - July 27, 2009 - 03:00

Why can't we just add field_backref_c1ca46882b44a6e3ea (or whatever it is for content type), as a views filter? That would be perfect.. Simply list all nodes with field_backref_c1ca46882b44a6e3ea = NULL.

#6

tpainton - October 29, 2009 - 02:14
Status:active» closed

Solved with beta 2.. see here

http://drupal.org/node/617610

#7

andypost - October 29, 2009 - 06:14
Status:closed» fixed

Use fixed status to give others ability to re-open this issue

#8

System Message - November 12, 2009 - 06:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.