? notices_210640.patch
? pathauto_24_2.patch
Index: pathauto.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.inc,v
retrieving revision 1.12
diff -u -p -r1.12 pathauto.inc
--- pathauto.inc	31 Dec 2007 20:18:54 -0000	1.12
+++ pathauto.inc	19 Jan 2008 21:21:36 -0000
@@ -368,7 +368,7 @@ function _pathauto_set_alias($src, $dst,
       }
     }
     if ($verbose and user_access('notify of path changes')) {
-      if ($redirect) {
+      if (isset($redirect) && $redirect) {
         drupal_set_message(t('Created new alias %dst for %src, replacing %old_alias. %old_alias now redirects to %dst', array('%dst' => $dst, '%src' => $src, '%old_alias' => $old_alias)));
       }
       elseif ($pid) {
Index: pathauto.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/pathauto/pathauto.module,v
retrieving revision 1.69
diff -u -p -r1.69 pathauto.module
--- pathauto.module	31 Dec 2007 20:18:54 -0000	1.69
+++ pathauto.module	19 Jan 2008 21:21:36 -0000
@@ -416,32 +416,32 @@ function pathauto_token_values($type, $o
           if (!isset($label)) {
             $label = 'cat';
           }
-          $separator = variable_get('pathauto_separator', '-');
-          $parents = taxonomy_get_parents_all($category->tid);
-          array_shift($parents);
-          $catpath = '';
-          $catpath_raw = '';
-          foreach ($parents as $parent) {
-            // Replace any / characters in individual terms which might create confusing URLs
-            $catpath = pathauto_cleanstring(check_plain(preg_replace('/\//', '', $parent->name))) .'/'. $catpath;
-            $catpath_raw = pathauto_cleanstring(preg_replace('/\//', '', $parent->name)) .'/'. $catpath_raw;
+          if (isset($category->tid)) {
+            $separator = variable_get('pathauto_separator', '-');
+            $parents = taxonomy_get_parents_all($category->tid);
+            array_shift($parents);
+            $catpath = '';
+            $catpath_raw = '';
+            foreach ($parents as $parent) {
+              // Replace any / characters in individual terms which might create confusing URLs
+              $catpath = pathauto_cleanstring(check_plain(preg_replace('/\//', '', $parent->name))) .'/'. $catpath;
+              $catpath_raw = pathauto_cleanstring(preg_replace('/\//', '', $parent->name)) .'/'. $catpath_raw;
+            }
+            $values[$label .'path'] = $catpath .'/'. check_plain($category->name);
+            $values[$label .'path-raw'] = $catpath_raw .'/'. $category->name;
+            
+            // We only do this for taxonomy because token already provides the [term] value but has problem with [cat] TODO: fix that?
+            if ($type == 'taxonomy') { 
+              $values[$label] = check_plain($category->name);
+              $values[$label .'-raw'] = $category->name;
+            }
+            
+            $values[$label .'alias'] = drupal_get_path_alias('taxonomy/term/'. $category->tid);
+            if (!strncasecmp($values[$label .'alias'], 'taxonomy', 8)) {
+              $values[$label .'alias'] = $values[$label];
+            }
           }
-          $values[$label .'path'] = $catpath .'/'. check_plain($category->name);
-          $values[$label .'path-raw'] = $catpath_raw .'/'. $category->name;
-          
-          // We only do this for taxonomy because token already provides the [term] value but has problem with [cat] TODO: fix that?
-          if ($type == 'taxonomy') { 
-            $values[$label] = check_plain($category->name);
-            $values[$label .'-raw'] = $category->name;
-          }
-          
-          $values[$label .'alias'] = drupal_get_path_alias('taxonomy/term/'. $category->tid);
-          if (!strncasecmp($values[$label .'alias'], 'taxonomy', 8)) {
-            $values[$label .'alias'] = $values[$label];
-          }
-          
-          // Provide some defaults if they aren't set.
-          if (!isset($values[$label .'path'])) {
+          else { // Provide some defaults if they aren't set.
             $values[$label .'path'] = '';
             $values[$label .'path-raw'] = '';
             $values[$label .'alias'] = '';
