Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-3.x-dev
Component:
taxonomy data
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Jun 2009 at 04:56 UTC
Updated:
26 Mar 2010 at 23:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
merlinofchaos commentedIsn't this handler going to always pull up all revisions?
Comment #2
yhahn commentedNo, because it joins back from
term_nodetonodeonvidnotnode_revisionsonnid. Since the node table only stores the latest vid/nid pair, you only get single nodes/latest revisions.Comment #3
merlinofchaos commentedThis is only going to be true if the handler uses an INNER join. In the case of a LEFT join you're going to get ghosts for revisions, I think, where the NID will be NULL because it doesn't exist.
Comment #4
yhahn commentedGood point -- this would mean changing the join entry for term_node then:
Are there any scenarios when you'd want a LEFT JOIN here?
Let me know what you think and I can reroll the patch.
Comment #5
yhahn commentedRerolled patch: fix for bad key 'field' (is now 'base field') in the relationship handler definition.
Regarding INNER vs LEFT join, the fact that this is a relationship handler means that the join type can be determined by the site builder by using the "Require this relationship" checkbox. In addition, if the site builder adds *any* filters against the node table using the relationship the "ghost" rows will be gone as well. I think it should be fine to leave this up to the user, but if it needs to be restricted we could always provide a custom relationship handler as well (that simply forces the 'required' option).
Comment #6
rsoden commentedThis patch applies and works as expected.
Comment #7
thill_ commentedThis might be out of the scope of the patch,
This causes duplicates without a way to filter them.
My use case here is filtering out terms without NID's associated with them.
I added the new relationship, and added a filter to NID is not empty.
The filter worked but i am getting the terms replicated because there is more than one node per term.
I did try the Distinct option in the view but that didn't help.
Term A - Node 1
Term A - Node 2
Term B - Node 3
Term B - Node 4
Comment #8
AntiNSA commentedsubscribe
Comment #9
AntiNSA commentedIf you can tell me how to get that list and a specific nid,
There is the group by mod that can put them together and count...
It cant do all terms like:
Node1 : Vocab A Term A , Vocab A Term B
Node2: Vocab A Term A
But if you have:
Term
nid
you can group by nid and then count,
Giving you
Term A 2
Term B 2
The problem is how do you get this:
Node1 : Vocab A Term A , Vocab A Term B
to be
Node1: Vocab A Terma
Node1:Node1 : Vocab A Term A , Vocab A Term B
Also I dont know if counting the same nid would work or if they all have to be unique.
Search for "Group by" module...
If you figure this out please post back here.
Are you saying if I apply this patch I can get those results using the standard exposed filter and all terms under fields?
Comment #10
marcushenningsen commentedJust tested the patch. I can confirm that it works.
I suppose it is expected that applying the relationship makes rows for every node for which the terms exist.
For me the distinct option works, as long as I only enable taxonomy fields.
Comment #11
marcushenningsen commentedBtw, using Views 2.6.
And thanks for the patch.
Comment #12
marcushenningsen commentedHm, I'm experiencing new issues with this patch with both versions of Views.
The view doesn't filter by node type, and distinct doesn't apply. In order to reproduce you need a vocabulary called 'tags' with some terms and two content types (of which one is called 'blog') and some nodes of both types tagged with some terms.
Views 3 export:
Comment #13
drewish commentedrestoring the status
Comment #14
merlinofchaos commented#12: Um. You didn't state what issues you are experiencing. =(
Comment #15
merlinofchaos commentedOk, I played with this a little and I'm not sure what #12 was about, but filtering seems to work for me. I did change the wording of the help text on the relationship, which might be part of the problem because it says 'the node' suggesting it will only retrieve one. It will in fact relate all nodes with that term, which may or may not be what you want. It certainly is what I want sometimes, so this relationship is something that's been needed for awhile. Thanks for the patch, and I committed this to all branches.
Comment #16
marcushenningsen commentedHm, I can't seem to remember myself, sorry about the vague description.