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

CommentFileSizeAuthor
#8 distinct.patch842 bytescatch

Comments

johnblade’s picture

As 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.

michelle’s picture

Priority: Normal » Minor

Thanks. I haven't had a chance to look into this, yet. I'll be spending time on AF probably later this week.

Michelle

michelle’s picture

Have 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

michelle’s picture

Status: Active » Postponed (maintainer needs more info)

Ok, I can't reproduce this with the latest dev. Can you upgrade and see if you still have a problem?

Michelle

CompShack’s picture

Michelle, 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.

michelle’s picture

Status: Postponed (maintainer needs more info) » Fixed

Ok, I'll mark it fixed, then. It can always be reopened if there's still a problem.

Thanks for the report,

Michelle

Status: Fixed » Closed (fixed)

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

catch’s picture

Priority: Minor » Normal
Status: Closed (fixed) » Needs review
StatusFileSize
new842 bytes

I 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.

michelle’s picture

Thanks, catch. I'll be working on AF again soon and will get this in.

Michelle

michelle’s picture

Issue tags: +Release blocker
michelle’s picture

Status: Needs review » Fixed
Issue tags: -Release blocker

Committed to both branches. Thanks.

Michelle

Status: Fixed » Closed (fixed)

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