I've got a bit of a weird problem. Any new forum thread that is created acts normally. When you click on a thread, it is rightly 'marked as read'.
The problem lies when users click on the 'Mark all topics read' it seems to remove any history of topics that are read. Therefore all newly created topics are shown us unread.
Clicking on the 'Mark all topics read' once does this, then clicking a second time brings up this error:
user warning: Duplicate entry '29-5103' for key 1 query: INSERT INTO drup_history (uid, nid, timestamp) SELECT 29, n.nid, 1227572311 FROM drup_node AS n INNER JOIN drup_term_node AS tn ON n.nid = tn.nid INNER JOIN drup_node_comment_statistics AS ncs ON ncs.nid = n.nid WHERE (n.created > 1224980311 OR ncs.last_comment_timestamp > 1224980311) AND tn.tid = 2 in /the/web/directory/modules/advanced_forum/advanced_forum.module on line 1009.
I've got a developer site where I've been trying to work this out - http://dev.lansmash.com
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | distinct.patch | 842 bytes | catch |
Comments
Comment #1
johnblade commentedAs an update - I found that going to the root Forum container and using 'Mark all forums read' works just fine.
This means a simple change will workaround the problem on my site for now as we only have One forum so marking everything as read is fine.
I changed the "forum/markasread/$nid" to "forum/markasread"
if ($tid) {
$title = t('Mark all topics read');
$link = "forum/markasread";
}
I'll run up a fresh database and see if I can recreate the error with a new Advanced_Forum install for Marking **Topic's** as read.
Changing priority to minor.
Comment #2
michelleThanks. I haven't had a chance to look into this, yet. I'll be spending time on AF probably later this week.
Michelle
Comment #3
michelleHave you worked on this any more? I haven't had a chance to look and having a patch to fix it would be real helpful. :)
Michelle
Comment #4
michelleOk, I can't reproduce this with the latest dev. Can you upgrade and see if you still have a problem?
Michelle
Comment #5
CompShack commentedMichelle, i've decided not to wait for the final 1.0 release and currently running dev on my production site http://www.CompShack.com/forum and don't think this is an issue any more.
Comment #6
michelleOk, I'll mark it fixed, then. It can always be reopened if there's still a problem.
Thanks for the report,
Michelle
Comment #8
catchI can reproduce this.
"Mark all forums as read" works OK for me.
"Mark all topics as read" from a forum, gives me:
Duplicate entry '11-23436' for key 1 query: INSERT INTO history (uid, nid, timestamp) SELECT 11, n.nid, 1231426848 FROM node AS n INNER JOIN term_node AS tn ON n.nid = tn.nid INNER JOIN node_comment_statistics AS ncs ON ncs.nid = n.nid WHERE (n.created > 1228834848 OR ncs.last_comment_timestamp > 1228834848) AND tn.tid = 728 in /home/libcom/www/drupal6/sites/all/modules/advanced_forum/advanced_forum.module on line 1026.
Seems most likely that it happens on forums with either shadow topics or additional taxonomy terms - or it might just be my old database. Either way, adding DISTINCT worked, so here's a patch.
Comment #9
michelleThanks, catch. I'll be working on AF again soon and will get this in.
Michelle
Comment #10
michelleComment #11
michelleCommitted to both branches. Thanks.
Michelle