From d80a410bb0aca4656df75414c7d797b805586235 Mon Sep 17 00:00:00 2001
From: Neil Drumm <drumm@3064.no-reply.drupal.org>
Date: Wed, 24 May 2006 04:54:52 +0000
Subject: [PATCH] #64951 by deepstar, Ambiguous query in
 taxonomy_get_term_by_name()

---
 modules/taxonomy.module          | 2 +-
 modules/taxonomy/taxonomy.module | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/taxonomy.module b/modules/taxonomy.module
index 2d3eb7c72217..ba7827d70cab 100644
--- a/modules/taxonomy.module
+++ b/modules/taxonomy.module
@@ -997,7 +997,7 @@ function _taxonomy_term_children($tid) {
  *   An array of matching term objects.
  */
 function taxonomy_get_term_by_name($name) {
-  $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));
+  $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));
   $result = array();
   while ($term = db_fetch_object($db_result)) {
     $result[] = $term;
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 2d3eb7c72217..ba7827d70cab 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -997,7 +997,7 @@ function _taxonomy_term_children($tid) {
  *   An array of matching term objects.
  */
 function taxonomy_get_term_by_name($name) {
-  $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));
+  $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));
   $result = array();
   while ($term = db_fetch_object($db_result)) {
     $result[] = $term;
-- 
GitLab