Index: modules/taxonomy/taxonomy.module =================================================================== --- modules/taxonomy/taxonomy.module (revision 53) +++ modules/taxonomy/taxonomy.module (working copy) @@ -826,7 +826,7 @@ // We cache trees, so it's not CPU-intensive to call get_tree() on a term // and its children, too. - if (!isset($children[$vid])) { + if (!isset($children[$vid]) || !taxonomy_get_enable_tree_cache()) { $children[$vid] = array(); $result = db_query(db_rewrite_sql('SELECT t.tid, t.*, parent FROM {term_data} t INNER JOIN {term_hierarchy} h ON t.tid = h.tid WHERE t.vid = %d ORDER BY weight, name', 't', 'tid'), $vid); @@ -859,6 +859,20 @@ return $tree; } +function taxonomy_get_enable_tree_cache() { + return taxonomy_set_enable_tree_cache(); +} + +function taxonomy_set_enable_tree_cache($enabled = NULL) { + static $cache_enabled = TRUE; + + if (!is_null($enabled)) { + $cache_enabled = $enabled; + } + + return $cache_enabled; +} + /** * Return an array of synonyms of the given term ID. */