I'm getting duplicate flagged nodes appearing in a view. The view is simple enough: No arguments; no fields (node view); a variety of content types. Nodes flagged by any user (flag is global) are filtered through and should appear.
However if a user flags a node for inclusion in the view, the user sees the node appear twice in the view. Actually any user that has flagged any node sees the duplicates. Users that have not flagged any nodes do not see the duplicates.
Has anyone seen this behavior? Where would I start to find a solution?
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #19 | abuse-notes.png | 137.29 KB | soulfroys |
| #19 | abuse-notes.sql_.txt | 1.28 KB | soulfroys |
| #19 | abuse-notes.view_.txt | 13.43 KB | soulfroys |
| #19 | abuse-comment.png | 111.34 KB | soulfroys |
| #19 | abuse-comments.sql_.txt | 2.27 KB | soulfroys |
Comments
Comment #1
quicksketchThis sounds like a configuration problem with your view. Could you post an export (preferably as an attachment)? I'd suggest removing fields one-by-one until the duplication disappears. You might also try using the "Distinct" option under the view settings.
Comment #2
swortis commented"Distinct" appears to have worked. Thanks, great tip. I never noticed it before.
(Attaching export of the view as someone may see something strange there.)
Comment #3
quicksketchI can't see any problems with the view itself, unless your flag "front_page" was an individual-user flag first, then you changed it to global later (or vice-versa). Another good debugging test is looking at the query that Views generates (it's down at the bottom of the view configuration page), and run it in a normal mySQL terminal or in PHPMyAdmin. If you get duplicate rows in the SQL result, you'll get duplicate rows in Views.
Then again, adding distinct fixes any of these problems, but from the looks of your configuration, it shouldn't really be necessary.
Comment #4
quicksketchWell regardless distinct has fixed the problem. Please reopen if there are further questions about your duplicate entries.
Comment #5
swortis commentedThe flag was indeed originally a individual-user flag. I noticed the error, went back and changed it to global, noticed some unexpected behavior and so uninstalled flag and reinstalled it. Perhaps the flags table never was removed?
Anyway, as you say choosing 'distinct' has solved it. Very much appreciate the guidance!
Comment #7
franzI'm getting that. I'll post the views export here. I've deleted all but the display that matters and the default (there were too many).
After a little debugging, I've found that there are 2 entries at the flag for the node in question, both identical except for the uid (0 and 1). This seems to be generating the duplicated results.
Comment #8
franzBTW, this seems to be related with a change of flag settings. The flag was global and the content was flagged. Then the flag changed to user and the content was flagged again. Trying to remove the flag doesn't work, as the flag won't go away. This might be related to another bug.
Comment #9
chrisroditis commentedIn my case, the DISTINCT only worked when I removed the field "Flags: Flagged time" and the Sort Criteria "Flags: Flagged time". I don't know if that helps in any way.
Comment #10
quicksketchClosing after lack of activity.
Comment #11
soulfroysOh man... I did everything (I gues), if a comment has more than one "abuse flag", it shows duplicate. Any help?
Comment #12
mooffie commented@soulfroys: doesn't 'distinct' solve your problem?
If it doesn't, our short guide to using the Views integration gives a tip: use the counter field and you won't see duplicate records (search that page for "duplicate").
Comment #13
soulfroysI tried 'distinct' and the 'counter field', but doesn't work... I simplify my view for best debugging.
I appreciate any help :)
Comment #14
soulfroysModules: flag + flag abuse + flag note. All with the last 6.x-1.x-dev. And the queries:
all_flag_abuse_comment_ORIGINAL:
all_flag_abuse_comment_PLUS_ABUSE_NOTE (I mean, 'flag note relationship'):
Comment #15
mooffie commentedBut where are the duplicate rows? I don't see them. Can you circle two that are duplicate?
(Thanks for formatting it so nicely!)
Comment #16
mooffie commentedI wrote a handbook page explaining this topic:
Getting rid of duplicate rows
Comment #17
mooffie commentedBump.
@soulfroys, can you show me the duplicate rows? If not, I believe the the handbook page (see my previous comment) explains everything there's to know and this issue should be closed.
Comment #18
mooffie commentedI'm getting no response so I'm closing this.
Comment #19
soulfroysSorry for the Absence.. :-(
@soulfroys, can you show me the duplicate rows?"
Please, see http://drupal.org/comment/reply/623956#comment-3488522
But.. don't worry, I make another approach (see png).
Tks for all help...