? content_taxonomy-n628014.patch
Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/content_taxonomy/README.txt,v
retrieving revision 1.3.2.1
diff -u -p -r1.3.2.1 README.txt
--- README.txt	6 Mar 2007 19:10:08 -0000	1.3.2.1
+++ README.txt	9 Nov 2009 21:37:26 -0000
@@ -20,6 +20,17 @@ If a parent is selected, only children o
 Additional you can choose whether the term is saved as a real tag in the term_node table (standard)
 or the term is only saved in a cck-table (so not a real term - node connection) 
 
+If you have a large number of terms in tag-based vocabularies and run into
+out-of-memory errors you can set the variable 'content_taxonomy_show_tags'
+to FALSE and they won't be added to the list, e.g. by adding this to your
+site's settings.php file:
+$conf['content_taxonomy_show_tags'] = FALSE;
+
+Alternatively, if you are just loading the entire vocabulary and don't care
+about assigning a parent term you can assign the following variable to stop
+all terms being loaded:
+$conf['content_taxonomy_load_terms'] = FALSE;
+
 
 
 content_taxonomy_options:
Index: content_taxonomy.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/content_taxonomy/content_taxonomy.module,v
retrieving revision 1.2.2.15.2.34
diff -u -p -r1.2.2.15.2.34 content_taxonomy.module
--- content_taxonomy.module	5 Sep 2009 11:11:44 -0000	1.2.2.15.2.34
+++ content_taxonomy.module	9 Nov 2009 21:37:26 -0000
@@ -448,10 +448,23 @@ function _content_taxonomy_get_all_terms
   static $options = array();
   if (!count($options)) {
     $options[0] = '---';
-    foreach (taxonomy_get_vocabularies() as $voc) {
-      foreach (taxonomy_get_tree($voc->vid) as $term) {
-        _content_taxonomy_localize_term($term);
-        $options[$voc->name][$term->tid] = str_repeat('- ', $term->depth) . $term->name;
+    // If you are just loading the entire vocabulary and don't care about
+    // assigning a parent term you can assign the following variable to stop
+    // all terms being loaded:
+    // $conf['content_taxonomy_load_terms'] = FALSE;
+    if (variable_get('content_taxonomy_load_terms', TRUE)) {
+      foreach (taxonomy_get_vocabularies() as $voc) {
+        // If you have a large number of terms in tag-based vocabularies and run
+        // into out-of-memory errors you can set the variable
+        // 'content_taxonomy_show_tags' to FALSE and they won't be added to the
+        // list, e.g. by adding this to your site's settings.php file:
+        // $conf['content_taxonomy_show_tags'] = FALSE;
+        if (!$voc->tag || variable_get('content_taxonomy_show_tags', TRUE)) {
+          foreach (taxonomy_get_tree($voc->vid) as $term) {
+            _content_taxonomy_localize_term($term);
+            $options[$voc->name][$term->tid] = str_repeat('- ', $term->depth) . $term->name;
+          }
+        }
       }
     } 
   }
