I've been seeing the following error in the dblog fairly frequently for several releases now:
Not unique table/alias: 'na' query: SELECT DISTINCT(n.nid), bt.name as biblio_type_name, b.biblio_year, b.biblio_date FROM node n left join biblio b on n.vid=b.vid inner join biblio_types bt on b.biblio_type=bt.tid 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 = 1 AND na.realm = 'node_privacy_byrole_role') OR (na.gid = 0 AND na.realm = 'node_privacy_byrole_user') OR (na.gid = 1 AND na.realm = 'workflow_access') OR (na.gid = 0 AND na.realm = 'workflow_access_owner') OR (na.gid = 0 AND na.realm = 'og_public'))) AND ( (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all') OR (na.gid = 1 AND na.realm = 'node_privacy_byrole_role') OR (na.gid = 0 AND na.realm = 'node_privacy_byrole_user') OR (na.gid = 1 AND na.realm = 'workflow_access') OR (na.gid = 0 AND na.realm = 'workflow_access_owner') OR (na.gid = 0 AND na.realm = 'og_public'))) AND ( (n.type='biblio' ) AND (n.status = 1 ) ))ORDER BY b.biblio_year , b.biblio_date LIMIT 10 in /var/www/live/drupal/sites/all/modules/biblio/biblio.module on line 1813.
Any ideas of how to fix it? I notice that node_access is being joined twice, could that be it? Thanks!
Comments
Comment #1
rjerome commentedHi Dane,
You hit the nail on the head there, I just noticed that db_rewrite_sql() is being called twice on the query, so that's why node_access is joined twice.
I think if you just delete line 1813 in the biblio module everything should be fine. I'm not even sure why that's there, but I suspect a cut'n'paste error.
Ron.
Comment #2
danepowell commentedThat appears to fix the problem, indeed. Thanks!
Comment #3
rjerome commentedCommitted to CVS... http://drupal.org/cvs?commit=317402
Ron.