Hi.

I get this error message when 'Refine By Taxonomy' running, and when a taxonomy term is called that is part of a vocab that is set to appear in a 'Refine by term' block.

user warning: Unknown table 'n' 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') OR (na.gid = 1 AND na.realm = 'liquid_access') OR (na.gid = 2 AND na.realm = 'liquid_access'))) AND ( (tn.nid IN (1)) AND (td.vid = 1) AND NOT (tn.tid IN (1) )) in /home/18098/domains/wrankr.com/html/includes/database.mysql.inc on line 172.

Other modules: Voting API, Liquid.

The install is fresh, as is the database.

Any ideas of how to fix it?

Thanks!

Tim

Comments

Bèr Kessels’s picture

Status: Active » Closed (duplicate)

duplicate. This is a bug in some access module wich rewrites the SQL wrong.

oldmanpants’s picture

Sorry about the redundancy. Found this.

#7 submitted by Roberto Gerola on February 28, 2007 - 13:10

In refine_by_taxo.module :

191: $sql = db_escape_string('SELECT DISTINCT tn.tid FROM {term_node} tn INNER JOIN {term_data} td ON td.tid = tn.tid WHERE' . $conditions);
192 : $result = db_query(db_rewrite_sql($sql));

The use of db_rewrite_sql function is not correct, it should be : db_rewrite_sql($sql, 'tn', 'tid')
Please, correct this, otherwise other modules cannot work correctly.

The parameters are explained here : http://api.drupal.org/api/HEAD/function/db_rewrite_sql

Bèr Kessels’s picture

Title: Error Message » SQL rewriting creates an error Message

This bug was reported earlier. PLease add your info to the other issue. (please search before posting)

syncopated’s picture

Where's the duplicate? I only see two support requests for this module, and the other one is not about this problem. BTW, I'm getting the problem, too, and I'm wondering whether this module is still being developed and supported since it hasn't been been updated or upgraded from 'dev' for months.

syncopated’s picture

I just saw the other issue, filed as a bug. Didn't see it earlier because I was looking at support requests.

JHeffner’s picture

Took me a bit to find .. duplicate is here http://drupal.org/node/122570