From 8cfbe41201754b1e0a27c8c6a34b732858c51054 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 14 Jun 2002 04:30:30 +0000 Subject: - Fixed a bug with taxonomy_get_related() returning the term which was passed in. Found by Moshe, fixed by Marco. --- modules/taxonomy.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/taxonomy.module') diff --git a/modules/taxonomy.module b/modules/taxonomy.module index 0d4b3e27b..b74480624 100644 --- a/modules/taxonomy.module +++ b/modules/taxonomy.module @@ -354,7 +354,7 @@ function taxonomy_node_delete($nid) { // relations: return array of related terms function taxonomy_get_related($tid, $key = "tid") { if ($tid) { - $result = db_query("SELECT t.*, tid1, tid2 FROM term_relation, term_data t WHERE (t.tid = tid1 OR t.tid = tid2) AND (tid1 = '%s' OR tid2 = '%s') ORDER BY weight", $tid, $tid); + $result = db_query("SELECT t.*, tid1, tid2 FROM term_relation, term_data t WHERE (t.tid = tid1 OR t.tid = tid2) AND (tid1 = '%d' OR tid2 = '%d') AND t.tid != '%d' ORDER BY weight", $tid, $tid, $tid); $related = array(); while ($term = db_fetch_object($result)) { $related[$term->$key] = $term; -- cgit v1.2.3