For non-admins the forum post count on /forum is 3 while UID 1 shows the correct post count of 2. I think the rewrite is screwing something up in forum_get_forums().

Before rewrite:

SELECT r.tid, COUNT(n.nid) AS topic_count, SUM(l.comment_count) AS comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid INNER JOIN {term_node} r ON n.nid = r.nid WHERE n.status = 1 AND n.type = 'forum' GROUP BY r.tid

After TAC rewrite:

SELECT r.tid, COUNT(DISTINCT(n.nid)) AS topic_count, SUM(l.comment_count) AS comment_count FROM {node} n INNER JOIN {node_comment_statistics} l ON n.nid = l.nid INNER JOIN {term_node} r ON n.nid = r.nid  INNER JOIN {node_access} na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 2 AND na.realm = 'term_access') OR (na.gid = 11 AND na.realm = 'term_access'))) AND ( n.status = 1 AND n.type = 'forum' ) GROUP BY r.tid

What other debug info should I provide to help figure this out?

Comments

RobRoy’s picture

It's actually the SUM(l.comment_count) AS comment_count that is coming in wrong.

RobRoy’s picture

Status: Active » Closed (duplicate)

Looks like this may be more of a forum/db_rewrite_sql error.

Dupe of http://drupal.org/node/113611.

jjrey’s picture

didnt mean to change issue title...

Akex’s picture

I find this problem for all taxonomy node counters, also in views.
Only the administrator can see tnem in the correct way: all other users see the counters multiplied.