From ca8416e03637b99cf5846e6e3116ce4d2fcee5a0 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 3 Dec 2009 20:21:50 +0000 Subject: - Patch #542658 by sun: follow-up on move action 'tabs' out of local tasks. --- modules/taxonomy/taxonomy.module | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'modules/taxonomy/taxonomy.module') 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; } -- cgit v1.2.3