Closed (duplicate)
Project:
Taxonomy Access Control
Version:
4.7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Feb 2007 at 02:55 UTC
Updated:
6 Aug 2010 at 14:43 UTC
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
Comment #1
RobRoy commentedIt's actually the SUM(l.comment_count) AS comment_count that is coming in wrong.
Comment #2
RobRoy commentedLooks like this may be more of a forum/db_rewrite_sql error.
Dupe of http://drupal.org/node/113611.
Comment #3
jjrey commenteddidnt mean to change issue title...
Comment #4
Akex commentedI 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.