I believe this error has been posted in several versions but have not been able to weed through this site to find a solution. My problems began when I needed to remove one role and add another. These problems arise for me centered around taxonomy_access, but others have reported similar errors centered around Organic Groups. Here are the errors:
Warning: Not unique table/alias: 'na' query: SELECT COUNT(*) FROM node n INNER JOIN node_access na ON na.nid = n.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 = 0 AND na.realm = 'simple_access') OR (na.gid = 2 AND na.realm = 'term_access'))) AND n.type = 'page' or n.type = 'story' AND n.status = 1 in /home/hclluser/public_html/includes/database.mysql.inc on line 120
Warning: Not unique table/alias: 'na' query: SELECT DISTINCT(n.nid), n.created FROM node n INNER JOIN node_access na ON na.nid = n.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 = 0 AND na.realm = 'simple_access') OR (na.gid = 2 AND na.realm = 'term_access'))) AND n.type = 'page' or n.type = 'story' AND n.status = 1 ORDER BY n.created DESC LIMIT 0, 5 in /home/hclluser/public_html/includes/database.mysql.inc on line 120
Warning: Not unique table/alias: 'na' query: SELECT COUNT(*) FROM node n INNER JOIN node_access na ON na.nid = n.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 = 0 AND na.realm = 'simple_access') OR (na.gid = 2 AND na.realm = 'term_access'))) AND n.type = 'forum' AND n.status = 1 in /home/hclluser/public_html/includes/database.mysql.inc on line 120
Warning: Not unique table/alias: 'na' query: SELECT DISTINCT(n.nid), n.created FROM node n INNER JOIN node_access na ON na.nid = n.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 = 0 AND na.realm = 'simple_access') OR (na.gid = 2 AND na.realm = 'term_access'))) AND n.type = 'forum' AND n.status = 1 ORDER BY n.created DESC LIMIT 0, 5 in /home/hclluser/public_html/includes/database.mysql.inc on line 120
If I start from scratch I can use taxonomy_access to control access to the forums with no problem. As soon as I expand out of the forums and try allowing a user access to a specific taxonomy term the error displays for the user while viewing a piece of content associated with the term. If I log in as user with ID 1 then no errors ... any other user produces the errors.
I believe the problem is related to http://drupal.org/node/51850 although I may be mistaken.
I do not know if this information will help identify the problem, but I installed the devel module and have this output from the problem content area. This only displays when I am logged in as user id 1 and there are no errors displayed (columns are | delimited):
node_access entries for nodes shown on this page
node | realm | gid | view | update | delete
Under Construction | all | 1 | 1 | 0 | 0
Under Construction | term_access | 2 | 1 | 0 | 0
I'm at the about to freak out stage because this site has already been turned over to the client who has been using succesfully. As of now, the entire site is functional without security in place but not functional when content is restricted. Unfortunately, the client insists their private content remain private. Help!!!
Best Regards,
Kevin Bridges
Comments
A bad workaround
I have to keep this site working so added the following to the _db_query function in database.mysql.inc
Terrible terrible fix, but it seems to work for me until someone with more knowledge of drupal can help identify the real problem/solution.