db_rewrite_sql tid ambiguos

gunzip - April 8, 2009 - 13:30
Project:Taxonomy Menu
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

hello when saving a node i get an error:

user warning: Column 'tid' in field list is ambiguous query: SELECT tid FROM term_node LEFT JOIN term_data tac_td ON t.tid = tac_td.tid WHERE (t.tid IN (0, 14) OR tac_td.vid NOT IN (4)) AND ( nid = 0) in /.../htdocs/sites/all/modules/taxonomy_menu/taxonomy_menu.database.inc on line 78.

function _taxonomy_menu_get_node_terms($nid) {
  $output = array();
  $result = db_query(db_rewrite_sql('SELECT tid FROM {term_node} WHERE nid = %d', 't', 'tid'), $nid);

should be

$result = db_query(db_rewrite_sql('SELECT t.tid FROM {term_node} WHERE nid = %d', 't', 'tid'), $nid);

#1

gunzip - April 8, 2009 - 13:47
Title:db_rewrite_sql tid ambigue» db_rewrite_sql tid ambiguos
Version:HEAD» 6.x-2.x-dev

sorry:

$result = db_query(db_rewrite_sql('SELECT t.tid FROM {term_node} t WHERE nid = %d', 't', 'tid'), $nid);

#2

indytechcook - April 8, 2009 - 18:48

Thanks gunzip. I'll patch this tonight along with the other db_rewrite_sql statements.

#3

indytechcook - April 8, 2009 - 22:20
Status:active» fixed

I committed this fix to DEV. The package should be available within the next 12 hours. Please test and let me know.

Thanks,
Neil

#4

System Message - April 22, 2009 - 22:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.