summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-12-03 20:21:50 +0000
committerDries Buytaert <dries@buytaert.net>2009-12-03 20:21:50 +0000
commitca8416e03637b99cf5846e6e3116ce4d2fcee5a0 (patch)
treec3017e25fa39d3f6caa46bc23fa2e7dd011412f3 /modules/taxonomy/taxonomy.module
parentd1a2de607e23da467c1366aca04ac5f61328a37a (diff)
downloadbrdo-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.module9
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;
}