If you try to vote a comment with localizer enabled, you'll get

user warning: Unknown table 'n' in on clause query: SELECT c.uid FROM comments c LEFT JOIN localizernode loc ON loc.nid=n.nid WHERE (loc.locale IN ('en','-') OR loc.locale IS NULL) AND ( c.cid = 2) in y:\home\d5\www\includes\database.mysql.inc on line 172.

To fix that replace the string 462 on vote_up_down.module to
$node = db_fetch_object(db_query(db_rewrite_sql('SELECT c.uid FROM {comments} c WHERE c.cid = %d', 'c'), $cid));
(just add 'c' as second parameter for db_rewrite_sql)

CommentFileSizeAuthor
#2 vote_up_down.module-195499.patch980 bytesfrjo

Comments

awong’s picture

Status: Needs review » Postponed (maintainer needs more info)

I try to vote a comment after i enabled the localizer module. but the error message didn't came up.
Are you using the newest version, if you still having the same problem, please give more detail on how to reproduce the error. Thanks

frjo’s picture

Assigned: Unassigned » frjo
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new980 bytes

I have not tested the localizer module but I think the documentation for db_rewrite_sql says that you should specify the table if it's not node.

http://api.drupal.org/api/function/db_rewrite_sql/5

Please try the attached patch and see if it works without side effects.

agentrickard’s picture

Status: Needs review » Reviewed & tested by the community

Patch works as advertised. This one is a little tricky to debug, because a user with 'administer nodes' permission will never have the node_access queries invoked.

frjo is correct about db_rewrite_sql().

frjo’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 5-dev.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.