I know this post will probably inspire audible groans as well as eye-rolling to the point of corneal damage, but I think I am inquiring about an aspect that is not posted anywhere and is different than the usual million versions of this post. (If not, please be kind :) )
I have several views listing events, people, etc. who are categorized by multiple taxonomy terms in a vocabulary, and the views filter for nodes belonging to one or more of those taxo terms. And the views result shows duplicates, one for each term. I know, you've heard this all before.
However, I've checked "Reduce Duplicates" under the filter settings for the taxo term, *and* I checked "Distinct" under the query setting.
I also changed from the Content version of the Taxonomy Term filter to the Term version (after much searching I finally found a discussion about this on Stack Overflow).
Still, I have the exact same amount of duplicates.
Is there something else I'm missing? There are so many different settings and variables, especially when you consider all the relatively new things done with contexts, relationships, etc.; so I'm wondering if this is some nuance to the new ways of dealing with all these controls in Views that I'm just not schooled in yet.
Comments
Comment #1
somatics commentedHere's one of my problematic Views' code, as that seems to be what people want to see next for this kind of situation:
Comment #2
merlinofchaos commentedIt's the taxonomy relationship. Once you add that relationship on a taxonomy with multiple terms per node, you're going to get duplicates pretty much no matter what you do. We do what we can to mitigate it, but ultimately we won't be able to.
Comment #3
somatics commentedThanks for the quick reply! So, that's it, huh? It's amazing there really has been no definitive cure found. It really shatters the fantasy that we have control over all this code we write.
Any chance you know why the three steps I tried don't work to correct this view but do work on other views?
I'd like to use that info to at least try to re-vamp this view in a different way with different filtering mechanisms -- it's a master list of events at this site, and it will mean the difference between hundreds of listings of the same nodes, effectively rendering this implementation of the view useless for any audience I can't outfit with special glasses!
Comment #4
merlinofchaos commentedMuch like Scotty can't change the laws of physics, I can't change the effects of SQL.
You can sometimes do something like this with the represenative relationship or views_field_view -- both of which ultimately embed queries within queries.
Comment #5
Dennis82 commentedlooks like the same problem -> http://drupal.org/node/1421650
Comment #6
Dennis82 commentedComment #7
merlinofchaos commentedI really hate being ignored.
Comment #8
merlinofchaos commentedDennis82: Also PLEASE read the meaning of the status values before changing them. You are not helping in any way.
Comment #9
Dennis82 commentedthis fixed it for me: http://drupal.org/node/1371252#comment-5650022
Comment #10
Dennis82 commentedComment #12
couturier commentedWow, so this is interesting. If I have a taxonomy vocabulary where I have set it to allow multiple terms per node, then merlinofchaos is saying I am going to get duplicates no matter what I do? Even if I've selected "is one of" or "is all of" and a single term within that vocabulary?
Comment #13
katrien_w commentedIf I set the aggregation function on the term cck field to MIN, the duplicates are gone.
I guess it's ok to do because I'm sure there will always be just one value in the term reference field.
Comment #14
mukun commentedEdit your view and go in Advance section of that View. Then enabling Use aggregation: "Yes" and then in Fields or Filter criteria make aggregation setting "Group Result Together" or "distinct.". Then only Unique value will display.
Note: If you are on Content view, Use aggregation only if you don't want sort the result of view.
Comment #15
SpiesInOrbit commentedIn case anyone else is having this issue. Aggregation didn't help, it rendered no results. Our issue was related to the multi-value fields.
I figured out which field had multiple values (the number of dupes matched the number of entries for that field). I then adjusted the "Multiple field settings" for that "Field" and changed it to display all in 1 row, I also set the result to display only the first entry. The first entry setting worked for our view, since we were only looking for whether the field was set or not (It may not be necessary if you want to see all the values in that field).
Comment #16
ecfukuda commentedI am having this issue too after updating the module to latest version...