Hi!

I am facing a problem with nodes showing up twice on my views. Is this a known issue? How can I debug it? The views related modules that I am using on top of the views module are views_fastsearch and views_fusion.

Thanks in advance,
Carlos.

CommentFileSizeAuthor
#33 Reduce-Duplicates.jpg62.56 KBDilir

Comments

zottmann’s picture

Some more information: the number of times that the node is displayed on the views is equal to the number of taxonomy terms assigned to it.

merlinofchaos’s picture

Status: Active » Fixed

Try the Node: Distinct filter.

zottmann’s picture

Hi!

Thanks for the tip, but unfortunately it didn´t fix the problem.

Done some more testing, and discovered that the problem disappears if I grant the user who is using the view the "Administer nodes" right, but I would not like to give this right to the average user of the site.

Any clues?

Thanks again,
Carlos.

merlinofchaos’s picture

Status: Fixed » Closed (won't fix)

Ahh, you're having a problem with the core db_rewrite_sql working with the taxonomy query causing duplicates. There's no fix for this, that I've been able to find. The best I can suggest is that you should make sure to set the depth option to 0; if you're already doing that, you're going to have to find another solution to whichever field/sort/filter is causing the duplicates. Sorry.

zottmann’s picture

Ouch!

This seems to be a hard one! Is there any history of fields/sorts/filters known to cause these problems?

Regards,
Carlos.

merlinofchaos’s picture

It's usually taxonomy with depth.

zottmann’s picture

I´m using the default taxonomy options, so its depth is set to 0.

I´ve upgraded Drupal from 5.1 to 5.7, and after it the problem appeared. It seems that the problem also only affects the nodes that were created after this upgrade. Is this a common scenario for this problem?

merlinofchaos’s picture

It sounds like there's something in 5.7 that's adding stuff to the query in the node_db_rewrite_sql which is handling access control -- which is why you don't see the problem for users with administer nodes access.

I'm not actually sure what changed there that might be causing this. :/

zottmann’s picture

Can a Drupal installation be downgraded? In this case, downgraded do 5.6?

gmclelland’s picture

Hi there, I am having the same problem. I'm simply trying to create a taxonomy index (view that displays a list of taxonomy terms), but each term appears multiple times in the listing. I have tried using the node distinct, but still had the same results. I am using Drupal 5.7, but I don't have views fast search or views fusion.

Please advise me on what I should do. Does this happen with any one else, or is this just an edge case?

I can post my view if you would like.

Thanks for the help.

zottmann’s picture

Hi!

I´m runnning two sites that showed this problem. One of them really was using a taxonomy view with a depth of 1, what was pointed out in comment #4 as a possible cause. Setting it to 0 solved the problem.

The second one is still showing the same problem, and I still need to investigate it further.

Regards,
Carlos.

ssn’s picture

hi all,

i was also facing the same problem. i added the filter node: distinct and put it on top of other filters. it worked and everything is fine now.

i thought this may be helpful for other users so posted here.

gmclelland’s picture

This happens to me on taxonomy_directory view as well.

zottmann’s picture

Hi!

Thanks for the tip. I´ve tried it, but then my view doesn´t display the table lines (i get an empty page), although it displays correctly the pagination links (first, page numbers, last) ... Very weird!!

I am running this site on a postgres database. Could it be the reason for this strange behaviour?

Regards,
Carlos.

david.drennan’s picture

Status: Closed (won't fix) » Active

I'm experiencing the exact same problem and I'm not even using taxonomy. Ive tried clearing the cache tables with no luck. I've noticed that It's always the same nodes that show in the table twice, even if I sort the table by something other than name the same nodes always show up twice. Does anyone have a suggestion on how to fix?

merlinofchaos’s picture

I set this won't fix because I can't fix it.

You desperately wanting me to will NOT CHANGE THAT FACT, it will only waste my time.

zottmann’s picture

Hi!

We understand that you cannot fix this problem, as it is related to Drupal Core, but this thread is still worthwhile as it can help us, who are facing this problem, to track it down, as it can render a site useless depending on its audience.

Is this problem reported to the Drupal Core team? If so, how can we provide them details of any hints that might help them solve this issue? If not, how can we report it?

Finally, I think we should thank you for this great module, as it is a big part of Drupal's strength.

Regards,
Carlos.

blairski’s picture

I had the same problem and Node District fixed it.

One thing to note, when I set node district and saved the view, I got an error saying that node district must have a value. I simple clicked save again and it saved without any problem and worked like a treat.

ps, my problem was caused by nodes having multiple terms

foaad’s picture

The "node distinct" solution definitely seems to be hit or miss here. It won't solve the problem with mine.

The views I had created under 5.0/5.2 seem to work fine. But new Views and modified views show this problem.

Has anyone checked 5.8 to see if that fixes it?

foaad’s picture

Some more light on this from my experience, FWIW. I think this explains why my "node: distinct" didn't work.

SELECT DISTINCT(node.nid), comments.timestamp AS comments_timestamp_timestamp FROM node node LEFT JOIN term_node term_node ON node.nid = term_node.nid LEFT JOIN term_hierarchy term_hierarchy ON term_node.tid = term_hierarchy.tid LEFT JOIN comments comments ON node.nid = comments.nid WHERE (node.status = '1') AND (term_node.tid = '127') GROUP BY node.nid, comments_timestamp_timestamp ORDER BY comments_timestamp_timestamp DESC LIMIT 0, 15

This is the mis-constructed query ( I guess by db_rewrite_sql ). The node.nid is distinct but if you have

SELECT DISTINCT(node.nid), comments.timestamp

you will get multiple nids from Mysql because the second term (comment) has multiple entries. But the only reason the comments is even here is because I had it in my "sort" portion at the bottom. So, it seems to me if you just don't SORT (and probably make no other reference) to multi-select CCK fields you should be OK with just node:distinct.

This worked for me. I just sorted on node created time, rather than comment time.

gmclelland’s picture

Still the same problem in Drupal 5.8.

N6546R’s picture

I have the same issue with both nodes and 'who's online' users appearing twice in views. It looks as though it is affecting users added after the upgrade to 5.7.

cyberskier’s picture

I've got this same problem with 5.10, and I'm not using taxonomy terms in my view.

sun’s picture

Status: Active » Closed (duplicate)
rc2020’s picture

Ok, I think I *might* have found a solution.

If Node: Distinct is the FIRST filter in the filter option, and sort: criteria is set to random, I am not showing any repeats of nodes, regardless of taxonomy tags. So far so good... I'll post this in the duplicate forum as well.

alexo007’s picture

Thank you corona ronin, this is working for me.
As info. for the ones with the same issue: If this is a problem with Drupal core it is not fixed until 5.12

ardelio’s picture

still repeated nodes, even with "Node: Distinct is the FIRST filter in the filter option, and sort: criteria is set to random"

vallab444’s picture

I faced the same problem in my V6.x installation. But setting Distinct=Yes in view: taxonomy_term fixed it> i didn't have a clue how to fix this, but this discussion gave me the leads. thanks

blanesworld’s picture

I had Duplicate events appearing in my calender view. I was able to fix this by clicking on "Date: Date (node)" in arguments. It turned out that I had two date fields selected (From date & To date). By checking only one field (From date), the duplicate views disappeared from the calendar.

Hope this helps.

ktristano’s picture

#29 fixed the issue for me, thanks!

ressa’s picture

I have installed the Node Access Node Reference module, which might have caused the access right system to get confused, I now have duplicates in certain views.
EDIT: I updated Views to 6.x-2.8 (2009-12-03) which fixed the problem for me.

Dilir’s picture

I had the same problem. I had several taxonomies on one node. For example one organization is a clinic and a diagnostic center at the same time. I used the option "Reduce Duplicates" option in the filter criteria. Now everything is fine.

Dilir’s picture

StatusFileSize
new62.56 KB

I had the same problem. I had several taxonomies on one node. For example one organization is a clinic and a diagnostic center at the same time. I used the option "Reduce Duplicates" option in the filter criteria. Now everything is fine.

rpai’s picture

It was happening to me even on Drupal7.21. Whenever I edited a node that was in the view it started to appear twice. Interestingly, what fixed it for me was the setting "Force using fields" (this is under Format->Unformatted List->Settings). When this setting was unchecked the duplicate disappeared.