Refer to http://drupal.org/node/42923 for more details

When taxonomy_access is enabled on the latest CVS version of drupal all users other than
admin (user #1) get the following error

user warning: Unknown column 'n.nid' in 'on clause' query: SELECT DISTINCT(n.nid), l.last_comment_timestamp, IF(l.last_comment_uid != 0, cu.name, l.last_comment_name) as last_comment_name, l.last_comment_uid FROM node n, node_comment_statistics l, users cu, term_node r 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 = 1 AND na.realm = 'term_access'))) AND n.nid = r.nid AND r.tid = 2 AND n.status = 1 AND n.type = 'forum' AND l.last_comment_uid = cu.uid AND n.nid = l.nid ORDER BY l.last_comment_timestamp DESC LIMIT 0, 1 in /var/drupal/includes/database.mysql.inc on line 118.

There is one error for each forum/catagory

This error disappears when taxonomy_access is disabled in the settings.

Comments

jm1234567890’s picture

Version: 4.7.0-beta4 » x.y.z
jm1234567890’s picture

http://drupal.org/node/46864

I guess refer to this as well, but this "fix" has already been added to the cvs

moshe weitzman’s picture

Priority: Critical » Minor
Zen’s picture

Project: Drupal core » Taxonomy Access Control
Version: x.y.z » master
Component: forum.module » Code
keve’s picture

Status: Active » Closed (fixed)

IMO, it is fixed with this: http://drupal.org/node/51850.

jm1234567890’s picture

Priority: Minor » Normal
Status: Closed (fixed) » Active

I tried it again and it doesn't appear to be fixed :(

keve’s picture

Can you paste here the exact error message that you get from SQL?

keve’s picture

I cannot regenerate problem.
On which page do you get this error? (link)
Are you sure you use latest forum.module cvs or 47 RC2?

On latest forum.module the sql query is fixed. It uses INNER JOIN command, instead of just FROM for tables:
FROM node n INNER JOIN node_comment_statistics l ON n.nid = l.nid INNER JOIN term_node r ON n.nid = r.nid AND r.tid = 20 INNER JOIN node_access na ON na.nid = n.nid

keve’s picture

Status: Active » Closed (fixed)

I close this, since IMO it is fixed with latest forum.module changes.