Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Even after updating to the new D6.22 and the -dev version of FA+AF and the lastest stable ACL1.4, I'm experiencing the wrong post count on the forum: all users (except admin) have a wrong number.
In the past the bug was on the core forum module:
- http://drupal.org/node/113611
- http://drupal.org/node/250041
but it has been fixed recently.
Now we have only a small bug left on the Advanced Forum code.
The db_rewrite_sql() called from advanced_forum_unread_replies_in_forum() doesn't set the primary table and the primary field.
Now we have:
if (module_exists("nodecomment")) {
$sql = "SELECT COUNT(nc.cid) AS count, f.tid
FROM {node_comments} nc
INNER JOIN {forum} f ON nc.nid = f.nid
INNER JOIN {node} n ON nc.cid = n.nid
INNER JOIN {node} tn ON nc.nid = tn.nid and f.vid = tn.vid
LEFT JOIN {history} h ON nc.nid = h.nid AND h.uid = %d
WHERE n.status = 1 AND n.changed > %d AND (n.changed > h.timestamp OR h.timestamp IS NULL)
GROUP BY f.tid";
$sql = db_rewrite_sql($sql);
}
But the db_rewrite_sql() should be:
$sql = db_rewrite_sql($sql, 'nc', 'cid');
Comment | File | Size | Author |
---|---|---|---|
#1 | nodecommentcount-1298490-1.patch | 524 bytes | FiNeX |
Comments
Comment #1
FiNeX CreditAttribution: FiNeX commentedSmall patch
Comment #2
mcdruidThanks FiNeX - committed to 6.x-2.x branch.