Mysql error
Robert_K - May 16, 2008 - 03:06
| Project: | Refine by taxonomy |
| Version: | 5.x-0.1 |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I'm getting this error thrown when I open a page with an anonymous user:
* user warning: Unknown column 'n.nid' in 'on clause' query: SELECT DISTINCT tn.tid FROM term_node tn INNER JOIN term_data td ON td.tid = tn.tid INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all'))) AND ( (tn.nid IN (66,65,64,63,62,61,60,59,58,57)) AND (td.vid = 2) AND NOT (tn.tid IN (18) )) in /home/robert/public_html/binaries/includes/database.mysql.inc on line 172.
* user warning: Unknown column 'n.nid' in 'on clause' query: SELECT DISTINCT tn.tid FROM term_node tn INNER JOIN term_data td ON td.tid = tn.tid INNER JOIN node_access na ON na.nid = n.nid WHERE (na.grant_view >= 1 AND ((na.gid = 0 AND na.realm = 'all'))) AND ( (tn.nid IN (66,65,64,63,62,61,60,59,58,57)) AND (td.vid = 1) AND NOT (tn.tid IN (18) )) in /home/robert/public_html/binaries/includes/database.mysql.inc on line 172.Everything works fine when I log in... I'm not sure if this is refine or taxonomy bug, but I really need it to work, so please tell me if anyone has any idea how to fix it.

#1
Yep, getting this too. Line 195 in refine_by_taxo.module should be changed from:
$result = db_query(db_rewrite_sql($sql));to:
$result = db_query(db_rewrite_sql($sql, 'tn', 'tid'));I think? (see this issue and api docs).
#2
This has been fixed in 5.x-dev since mid-April. Its quite a major problem, should we bundle a 5.x-0.2 version?