diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-05-04 08:38:34 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-05-04 08:38:34 +0000 |
commit | 304400293a997a76290f04c7d1d65680fef2c7d8 (patch) | |
tree | 7cab4ce7334431eec867318ea00efda780899c5d /modules | |
parent | f0b273a9656faf9a523c670e08a7b633a294c3cd (diff) | |
download | brdo-304400293a997a76290f04c7d1d65680fef2c7d8.tar.gz brdo-304400293a997a76290f04c7d1d65680fef2c7d8.tar.bz2 |
- Patch #141204 by Wim Leers: fixing caching bug in taxonomy_node_get_terms().
Diffstat (limited to 'modules')
-rw-r--r-- | modules/taxonomy/taxonomy.module | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 92d0139cb..e6d4ce518 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -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]; } /** |