summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2002-06-14 04:30:30 +0000
committerDries Buytaert <dries@buytaert.net>2002-06-14 04:30:30 +0000
commit8cfbe41201754b1e0a27c8c6a34b732858c51054 (patch)
tree58013282f4a9e34bc4560c5e6b76a8557868d376 /modules/taxonomy/taxonomy.module
parent53a53ce6db3cd1afb0b66bccbdf0bd6cd251db8c (diff)
downloadbrdo-8cfbe41201754b1e0a27c8c6a34b732858c51054.tar.gz
brdo-8cfbe41201754b1e0a27c8c6a34b732858c51054.tar.bz2
- Fixed a bug with taxonomy_get_related() returning the term which
was passed in. Found by Moshe, fixed by Marco.
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r--modules/taxonomy/taxonomy.module2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index 0d4b3e27b..b74480624 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/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;