diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-12-03 20:21:50 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-12-03 20:21:50 +0000 |
commit | ca8416e03637b99cf5846e6e3116ce4d2fcee5a0 (patch) | |
tree | c3017e25fa39d3f6caa46bc23fa2e7dd011412f3 /modules/taxonomy/taxonomy.module | |
parent | d1a2de607e23da467c1366aca04ac5f61328a37a (diff) | |
download | brdo-ca8416e03637b99cf5846e6e3116ce4d2fcee5a0.tar.gz brdo-ca8416e03637b99cf5846e6e3116ce4d2fcee5a0.tar.bz2 |
- Patch #542658 by sun: follow-up on move action 'tabs' out of local tasks.
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r-- | modules/taxonomy/taxonomy.module | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module index 79826cc19..83c71e06e 100644 --- a/modules/taxonomy/taxonomy.module +++ b/modules/taxonomy/taxonomy.module @@ -646,6 +646,12 @@ function taxonomy_get_parents($tid, $key = 'tid') { * Find all ancestors of a given term ID. */ function taxonomy_get_parents_all($tid) { + $cache = &drupal_static(__FUNCTION__, array()); + + if (isset($cache[$tid])) { + return $cache[$tid]; + } + $parents = array(); if ($term = taxonomy_term_load($tid)) { $parents[] = $term; @@ -655,6 +661,9 @@ function taxonomy_get_parents_all($tid) { $n++; } } + + $cache[$tid] = $parents; + return $parents; } |