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 |
Jump to:
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
sorry:
$result = db_query(db_rewrite_sql('SELECT t.tid FROM {term_node} t WHERE nid = %d', 't', 'tid'), $nid);#2
Thanks gunzip. I'll patch this tonight along with the other db_rewrite_sql statements.
#3
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
Automatically closed -- issue fixed for 2 weeks with no activity.