For some reason I ran into this bug
user warning: Column 'name' in where clause is ambiguous query: SELECT t.tid, t.* FROM term_data t LEFT JOIN term_data catd ON t.tid = catd.tid WHERE (t.tid IN (0) OR catd.vid NOT IN (1)) AND LOWER('b') LIKE LOWER(name) in /someplace/includes/database.mysql.inc on line 120.
when calling taxonomy_get_term_by_name().
This is the problem in the code (taxonomy.module line 1012):
$db_result = db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term_data} t WHERE LOWER('%s') LIKE LOWER(name)", 't', 'tid'), trim($name));
And should be replaced by:
$db_result = db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term_data} t WHERE LOWER('%s') LIKE LOWER(t.name)", 't', 'tid'), trim($name));
(LOWER(name) changed into LOWER(t.name))
kind regards,
-- Steven
Comments
Comment #1
gerhard killesreiter commentednot a patch
Comment #2
deepstar commentedHere you go
Comment #3
killes@www.drop.org commentedThanks, please try to create patches from the root directory.
applied
Comment #4
drummCommitted to HEAD
Comment #5
(not verified) commented