[drupal-devel] [bug] Comment Block for Anonymous Users

timothy bennett drupal-devel at drupal.org
Thu Mar 24 21:57:42 UTC 2005


Issue status update for http://drupal.org/node/19405

 Project:      Drupal
 Version:      cvs
 Component:    node system
 Category:     bug reports
 Priority:     normal
 Assigned to:  Anonymous
 Reported by:  timothy bennett
 Updated by:   timothy bennett
 Status:       active

I'm running the latest CVS update of Drupal 4.6 RC (as of 23 MAR 2005),
and I'm getting the following database error when an Anonymous user
access my site, and the comment block is NOT populated with the latest
comment links.
user error: Unknown table 'n' in on clause
query: SELECT DISTINCT(c.nid), c.* FROM comments c  INNER JOIN
node_access na ON na.nid = n.nid WHERE  (na.grant_view = 1 AND
CONCAT(na.realm, na.gid) IN
('all0','node_privacy_byrole_role1','node_privacy_byrole_user0')) AND 
c.status = 0 ORDER BY c.timestamp DESC LIMIT 0, 10 in
/opt/lampp/htdocs/includes/database.mysql.inc on line 66.
Once a user is authenticated, everything works fine.  I've poked around
the code some, and I'm pretty sure that "n.nid" should be "c.nid", but
that is not getting built by the sql query builder (possibly in
node.module).  The comment block generation function in comment.module
is passing a 'c' argument to the query builder, but whatever is
building the query seems to be ignoring that argument and using 'n'
instead.
I'm trying to dig and understand how this code works, but I need a
little help.  Thanks!


timothy bennett




More information about the drupal-devel mailing list