[drupal-devel] [bug] Comment Block for Anonymous Users
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
Issue status update for http://drupal.org/node/19405 Project: Drupal Version: cvs Component: node system Category: bug reports Priority: normal -Assigned to: Anonymous +Assigned to: chx Reported by: timothy bennett Updated by: chx -Status: active +Status: patch Attachment: http://drupal.org/files/issues/node_access_alias.patch (526 bytes) Here is the fix. chx Previous comments: ------------------------------------------------------------------------ March 24, 2005 - 22:57 : timothy bennett 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!
Issue status update for http://drupal.org/node/19405 Project: Drupal Version: cvs Component: node system Category: bug reports Priority: normal Assigned to: chx Reported by: timothy bennett Updated by: timothy bennett Status: patch Actually, I had tested this fix on my own as I was exploring my problem. It would seem like this patch doesn't fix my problem, but unfortunately it doesn't. I'm digging some more... timothy bennett Previous comments: ------------------------------------------------------------------------ March 24, 2005 - 21:57 : timothy bennett 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! ------------------------------------------------------------------------ March 24, 2005 - 22:05 : chx Attachment: http://drupal.org/files/issues/node_access_alias.patch (526 bytes) Here is the fix.
Issue status update for http://drupal.org/node/19405 Project: Drupal Version: cvs Component: node system Category: bug reports Priority: normal Assigned to: chx Reported by: timothy bennett Updated by: timothy bennett Status: patch Would the node_privacy_byrole module be affecting this somehow... I do have this module switched on, even though it hasn't been *officially* ported to 4.6 yet. timothy bennett Previous comments: ------------------------------------------------------------------------ March 24, 2005 - 21:57 : timothy bennett 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! ------------------------------------------------------------------------ March 24, 2005 - 22:05 : chx Attachment: http://drupal.org/files/issues/node_access_alias.patch (526 bytes) Here is the fix. ------------------------------------------------------------------------ March 24, 2005 - 22:17 : timothy bennett Actually, I had tested this fix on my own as I was exploring my problem. It would seem like this patch doesn't fix my problem, but unfortunately it doesn't. I'm digging some more...
Issue status update for http://drupal.org/node/19405 Project: Drupal Version: cvs Component: node system Category: bug reports Priority: normal Assigned to: chx Reported by: timothy bennett Updated by: chx -Status: patch +Status: active Please elaborate on what's your problem now. I have just checked, and the query is rewritten properly, in the ON clause we have c.nid as there should be. Do you get an SQL error still? Or just the functionality is not there? chx Previous comments: ------------------------------------------------------------------------ March 24, 2005 - 22:57 : timothy bennett 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! ------------------------------------------------------------------------ March 24, 2005 - 23:05 : chx Attachment: http://drupal.org/files/issues/node_access_alias.patch (526 bytes) Here is the fix. ------------------------------------------------------------------------ March 24, 2005 - 23:17 : timothy bennett Actually, I had tested this fix on my own as I was exploring my problem. It would seem like this patch doesn't fix my problem, but unfortunately it doesn't. I'm digging some more... ------------------------------------------------------------------------ March 24, 2005 - 23:19 : timothy bennett Would the node_privacy_byrole module be affecting this somehow... I do have this module switched on, even though it hasn't been *officially* ported to 4.6 yet.
participants (2)
-
chx -
timothy bennett