Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.329
diff -u -p -r1.329 taxonomy.module
--- modules/taxonomy/taxonomy.module   20 Dec 2006 10:32:16 -0000   1.329
+++ modules/taxonomy/taxonomy.module   31 Dec 2006 01:36:02 -0000
@@ -959,13 +959,23 @@ function taxonomy_get_children($tid, $vi
  * @param $max_depth
  *   The number of levels of the tree to return. Leave NULL to return all levels.
  *
+ * @param $reset
+ *   Whether to reset the internal taxonomy tree static cache.
+ *
  * @return
  *   An array of all term objects in the tree. Each term object is extended
  *   to have "depth" and "parents" attributes in addition to its normal ones.
  *   Results are statically cached.
  */
-function taxonomy_get_tree($vid, $parent = 0, $depth = -1, $max_depth = NULL) {
-  static $children, $parents, $terms;
+function taxonomy_get_tree($vid, $parent = 0, $depth = -1, $max_depth = NULL, $reset = FALSE) {
+  static $children = array(), $parents = array(), $terms = array();
+
+  if ($reset) {
+    $children = array();
+    $parents = array();
+    $terms = array();
+  }
 
   $depth++;
