I have a view with this sort criteria: http://img391.imageshack.us/img391/6243/views01nx4.jpg
and results are: http://img292.imageshack.us/img292/1313/views02pg0.jpg

If I add a taxonomy weight sort: http://img391.imageshack.us/img391/4479/views03nq6.jpg
and results are: http://img391.imageshack.us/img391/3117/views04ql9.jpg

I don't know if that is a bug, but:
* If I select "Distinct=Yes" then the view's results changes: http://img364.imageshack.us/img364/6707/views06tr0.jpg. They aren't correct.
* This problem happens with or without arguments defined.

Comments

merlinofchaos’s picture

Status: Active » Fixed

When using a taxonomy weight sort you will get duplicate results based on the # of terms on the node. You would need to add a vocabulary filter to reduce this again.

In situations like this, I find distinct to be unreliable with mysql.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

OliverColeman’s picture

Version: 6.x-2.0-rc1 » 6.x-2.6
Component: node data » Code

I'm guessing this is the same issue:

I'm using the nodeorder module to order nodes in taxonomy terms and using a view that sorts by weight_in_tid (provided by nodeorder); distinct is set to "yes". If I remove the weight_in_tid sort criteria the duplicates go away.

The node being duplicated in the view is listed under two terms from the same vocab. If I remove one of those terms the duplicates go away.

This only occurred after an upgrade from D5 to D6 (D5 site used the same nodeorder and views setup, but without this duplicates in views issue).

The SQL looks fine, so perhaps it's due to unreliable distinct results from mysql (we're using version 5.0.51a on a standard Debian install):

SELECT DISTINCT(node.nid) AS nid,
   term_node.weight_in_tid AS term_node_weight_in_tid
 FROM node node 
 LEFT JOIN term_node term_node ON node.vid = term_node.vid
 WHERE (node.status <> 0 OR (node.uid = ***CURRENT_USER*** AND ***CURRENT_USER*** <> 0) OR ***ADMINISTER_NODES*** = 1) AND (node.vid IN (
  SELECT tn.vid FROM term_node tn
  WHERE tn.tid  = 60
  ))
   ORDER BY term_node_weight_in_tid ASC
OliverColeman’s picture

Status: Closed (fixed) » Active
merlinofchaos’s picture

Status: Active » Closed (fixed)

#4, please read the issue submission guidelines. This clearly should have been posted against the module providing the field.

bartezz’s picture

Thanx for this, I had problems with duplicates as well, distinct wasn't working here either.
I sorted by Taxonomy: weight ASC and had duplicates.

After reading your comment I added a filter;

- Taxonomy: Term
- 'is one off'
- selected all terms within that vocab
- checked reduce duplicates

This has removed all duplicates...

Thanx

yurtboy’s picture

right but what happens if they add more terms later do they have to go here and fix it?

This seems to be a huge bug, not maybe with views cause I ran the SQL views shows in MySQL and the same thing. I add Group by NID that worked but that can not be it.

So I wonder figuring %50 of the users need nodes to have more then one Term (in the same vocab) that there has to be a fix. If anyone knows just send me an email else I will keep searching.