Index: nodehierarchy_token.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nodehierarchy/includes/nodehierarchy_token.inc,v
retrieving revision 1.2
diff -u -r1.2 nodehierarchy_token.inc
--- nodehierarchy_token.inc	25 May 2009 20:43:10 -0000	1.2
+++ nodehierarchy_token.inc	25 Aug 2010 22:55:36 -0000
@@ -49,8 +49,8 @@
 
     $tokens['node']['hierarchytitlepath']          = t("The node's ancestors' titles in order. Separated by /.");
     $tokens['node']['hierarchytitlepath-raw']      = t("The node's ancestors' titles in order. Separated by /. WARNING - raw user input.");
-    $tokens['node']['fullhierarchytitlepath']      = t("The node's ancestors' titles in order the title of the node itself. Separated by /. Equivalent of [hierarchypath]/[title].");
-    $tokens['node']['fullhierarchytitlepath-raw']  = t("The node's ancestors' titles in order the title of the node itself. Separated by /. Equivalent of [hierarchypath]/[title]. WARNING - raw user input.");
+    $tokens['node']['fullhierarchytitlepath']      = t("The node's ancestors' titles in order of the title of the node itself. Separated by /. Equivalent of [hierarchypath]/[title].");
+    $tokens['node']['fullhierarchytitlepath-raw']  = t("The node's ancestors' titles in order of the title of the node itself. Separated by /. Equivalent of [hierarchypath]/[title]. WARNING - raw user input.");
 
     return $tokens;
   }
@@ -58,7 +58,6 @@
 
 function nodehierarchy_token_get_fullhierarchytitlepath($node, $raw = TRUE) {
   $title = $raw ? $node->title : check_plain($node->title);
-
   // return the hierarchy path with the converted title
   return trim(nodehierarchy_token_get_hierarchytitlepath($node->nid, $raw) ."/". $title, "/");
 }
@@ -73,6 +72,14 @@
 }
 
 function nodehierarchy_token_get_fullhierarchypath($node) {
+  // pathauto used to strip spaces but, as of 1.4 we need to run through pathauto_cleanstring
+  // per http://drupal.org/node/881270. Also works in pathauto < 1.4
+  if (module_exists('pathauto')) {
+    module_load_include('inc', 'pathauto', 'pathauto');
+    if (function_exists('pathauto_cleanstring')) {
+      return trim(nodehierarchy_token_get_hierarchypath($node->nid) ."/". pathauto_cleanstring($node->title), "/");
+    }
+  }
   return trim(nodehierarchy_token_get_hierarchypath($node->nid) ."/". $node->title, "/");
 }
 
@@ -83,9 +90,7 @@
     // if the parent already has an alias (generated or entered) use that
     $parent_path = drupal_get_path_alias("node/$pnid");
     if ($parent_path != "node/$pnid") {
-      // replace the separator with a space, so that pathauto replaces it with the separator again.
-      // a little hacky but prevents the separator from being stripped
-      return str_replace(variable_get('pathauto_separator', '-'), " ", $parent_path);
+      return $parent_path;
     }
     else {
       // recurse

