Skip to content

Commit

Permalink
- Patch #141204 by Wim Leers: fixing caching bug in taxonomy_node_get…
Browse files Browse the repository at this point in the history
…_terms().
  • Loading branch information
dbuytaert committed May 4, 2007
1 parent f0b273a commit 3044002
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions modules/taxonomy/taxonomy.module
Expand Up @@ -774,14 +774,14 @@ function taxonomy_node_get_terms_by_vocabulary($node, $vid, $key = 'tid') {
function taxonomy_node_get_terms($node, $key = 'tid') {
static $terms;

if (!isset($terms[$node->vid])) {
if (!isset($terms[$node->vid][$key])) {
$result = db_query(db_rewrite_sql('SELECT t.* FROM {term_node} r INNER JOIN {term_data} t ON r.tid = t.tid INNER JOIN {vocabulary} v ON t.vid = v.vid WHERE r.vid = %d ORDER BY v.weight, t.weight, t.name', 't', 'tid'), $node->vid);
$terms[$node->vid] = array();
$terms[$node->vid][$key] = array();
while ($term = db_fetch_object($result)) {
$terms[$node->vid][$term->$key] = $term;
$terms[$node->vid][$key][$term->$key] = $term;
}
}
return $terms[$node->vid];
return $terms[$node->vid][$key];
}

/**
Expand Down

0 comments on commit 3044002

Please sign in to comment.