? 231292_32_mb_ereg_replacing.patch
? 239770_2_bulk_generate_vocabs_more_than_max.patch
? 239770_3_bulk_generate_vocabs_more_than_max.patch
Index: pathauto.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.inc,v
retrieving revision 1.1.2.40
diff -u -p -r1.1.2.40 pathauto.inc
--- pathauto.inc	10 May 2008 20:57:08 -0000	1.1.2.40
+++ pathauto.inc	13 May 2008 08:29:01 -0000
@@ -161,8 +161,8 @@ function pathauto_cleanstring($string, $
   // Get rid of words that are on the ignore list
   $ignore_re = "\b". preg_replace('/,/', "\b|\b", variable_get('pathauto_ignore_words', $ignore_words)) ."\b";
 
-  if (function_exists('mb_ereg_replace')) {
-    $output = mb_ereg_replace("/$ignore_re/i", '', $output);
+  if (function_exists('mb_eregi_replace')) {
+    $output = mb_eregi_replace("/$ignore_re/i", '', $output);
   }
   else {
     $output = preg_replace("/$ignore_re/i", '', $output);
Index: pathauto_taxonomy.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto_taxonomy.inc,v
retrieving revision 1.20.4.27
diff -u -p -r1.20.4.27 pathauto_taxonomy.inc
--- pathauto_taxonomy.inc	10 May 2008 20:33:42 -0000	1.20.4.27
+++ pathauto_taxonomy.inc	13 May 2008 08:29:01 -0000
@@ -48,9 +48,36 @@ function taxonomy_pathauto($op) {
  * 
  */ 
 function taxonomy_pathauto_bulkupdate() {
-  $forum_vid = variable_get('forum_nav_vocabulary', '');
-  $query = "SELECT tid, vid, name, src, dst FROM {term_data} LEFT JOIN {url_alias} ON CONCAT('taxonomy/term/', CAST(tid AS CHAR)) = src WHERE src IS NULL AND vid <> %d";
-  $result = db_query_range($query, $forum_vid, 0, variable_get('pathauto_max_bulk_update', 50));
+  // From all node types, only attempt to update those with patterns
+  $pattern_vids = array();
+  $vid_where = '';
+  foreach (taxonomy_get_vocabularies() as $vid => $info) {
+    $pattern = '';
+    $pattern = variable_get('pathauto_taxonomy_'. $vid .'_pattern', '');
+    
+    // If it's not set, check the default
+    // TODO - if there's a default we shouldn't do this crazy where statement because all vocabs get aliases
+    // TODO - special casing to exclude the forum vid (and the images vid and...?)
+    if (!trim($pattern)) {
+      $pattern = variable_get('pathauto_taxonomy_pattern', '');
+    }
+    if (trim($pattern)) {
+      $pattern_vids[] = $vid;
+      if (!trim($vid_where)) {
+        $vid_where = " AND (vid = '%s' ";
+      }
+      else {
+        $vid_where .= " OR vid = '%s'";
+      }
+    }
+  }
+  $vid_where .= ')';
+
+  // Exclude the forums and join all the args into one array so they can be passed to db_query
+  $forum_vid[] = variable_get('forum_nav_vocabulary', '');
+  $query_args = array_merge($forum_vid, $pattern_vids);
+  $query = "SELECT tid, vid, name, src, dst FROM {term_data} LEFT JOIN {url_alias} ON CONCAT('taxonomy/term/', CAST(tid AS CHAR)) = src WHERE src IS NULL AND vid != %d ". $vid_where;
+  $result = db_query_range($query, $query_args, 0, variable_get('pathauto_max_bulk_update', 50));
 
   $count = 0;
   $placeholders = array();
