Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.0-rc1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
9 Nov 2011 at 18:15 UTC
Updated:
14 Jun 2017 at 07:17 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ghaddon commentedTo get around the problem i added this php filter:
Comment #2
kip stanning commentedgot the same problem with nodes and a contextual filter on terms.
i use a field called "Stichwort" wich is a term reference to the vocabulary "Tags".
i created a relationship to Content: Stichwort and a second relationship using the first one "Taxonomy Term: Content using Stichwort". This allowed me to set a contextual filter "(term from field_stichwort) Taxonomy-term: Name".
this works only half-way through the task: the requested summary is created and the count of results is displayed in parentheses. but duplicates are not reduced, e.g. in the summary you find "Richtlinie (2)" twice (see screenshot).
any ideas would be very much appreciated.
regards from vienna forest
karl
Comment #3
WhiteWinterWolf commentedHello,
Just in case some other may go through the same page, this solves the issue in most cases : in the view details, go in "Advanced" > "OTHER" > "Query settings", then check the box "Distinct".
Views will then add the "distinct" keyword to its SQL request in order to ask the database server to remove any duplicates.
Best regards,
Simon.
Comment #4
dawehner@kip stanning
In many cases duplicates in connection with taxonomy terms are a configuration/misunderstanding of the way sql works.
If you want to display taxonomy terms, and you don't use a summary query you want to have a view of terms not of nodes....
Comment #5
couturier commentedI've seen comments many places similar to dawehner's above, that duplicates can simply be a misconfiguration problem. See this comment: http://drupal.org/node/345571#comment-1188223
Comment #6
jessZ commented# 3 worked like a charm. +1 "Advanced" > "OTHER" > "Query settings", then check the box "Distinct".
under the same tab I was wondering what the
"Query Tags
If set, these tags will be appended to the query and can be used to identify the query in a module. This can be helpful for altering queries."
setting meant, got a small error because the default was Array and the error message asked for lower case. I don't think we are using this anyway but i changed it to "array." this should help me clean up quite a few views.
Hello,
Just in case some other may go through the same page, this solves the issue in most cases : in the view details, go in "Advanced" > "OTHER" > "Query settings", then check the box "Distinct".
Views will then add the "distinct" keyword to its SQL request in order to ask the database server to remove any duplicates.
Best regards,
Simon.
Comment #7
abrlam commentedJust writing this down for future reference. Hope that helps.
Besides checking "Distinct" in the View setting, check whether module Taxonomy Set Lineage is installed and enabled on your site. If it is, try disabling it and add another node for testing to see if the duplicate issue persists.
Also, try saving the nodes (that produce the duplicates in the view) again and see if it fixes the problem.
*Some clean up work (adjusting the view, disabling violating modules) might be needed.
The following query will get all the taxonomy terms that have been applied to the node specified.
Comment #8
nayanalok commentedAfter spending a lot of time on this I found this in one post.
Edit the view's "Query settings" as follows:
a) Enable "Disable SQL rewriting"; and
b) Disable "Distinct".
This is what has worked for me on my bookshelf view to show distinct products.