summaryrefslogtreecommitdiff
path: root/modules/taxonomy/taxonomy.module
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2008-09-24 18:42:00 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2008-09-24 18:42:00 +0000
commit991ff539c32bb61bffb4b41d132bb3b8b35c8ece (patch)
treea34cf527ea6472dcc0922ed52e72fc8750f2dd3e /modules/taxonomy/taxonomy.module
parentb43010c5bdccb7b898aa1c3ca8f92f98d9e03c57 (diff)
downloadbrdo-991ff539c32bb61bffb4b41d132bb3b8b35c8ece.tar.gz
brdo-991ff539c32bb61bffb4b41d132bb3b8b35c8ece.tar.bz2
#296910 by catch and webchick: Add reset parameter to taxonomy_vocabulary_load().
Diffstat (limited to 'modules/taxonomy/taxonomy.module')
-rw-r--r--modules/taxonomy/taxonomy.module11
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/taxonomy/taxonomy.module b/modules/taxonomy/taxonomy.module
index a93ef9fb0..438ddf0fe 100644
--- a/modules/taxonomy/taxonomy.module
+++ b/modules/taxonomy/taxonomy.module
@@ -985,15 +985,22 @@ function taxonomy_get_term_by_name($name) {
* Return the vocabulary object matching a vocabulary ID.
*
* @param $vid
- * The vocabulary's ID
+ * The vocabulary's ID.
+ *
+ * @param $reset
+ * A boolean flag indicating whether to reset the internal cache.
*
* @return
* The vocabulary object with all of its metadata, if exists, FALSE otherwise.
* Results are statically cached.
*/
-function taxonomy_vocabulary_load($vid) {
+function taxonomy_vocabulary_load($vid, $reset = FALSE) {
static $vocabularies = array();
+ if ($reset) {
+ unset($vocabularies[$vid]);
+ }
+
if (empty($vocabularies[$vid])) {
// Initialize so if this vocabulary does not exist, we have
// that cached, and we will not try to load this later.