Index: contrib/category_pathauto/category_pathauto.module
===================================================================
RCS file: contrib/category_pathauto/category_pathauto.module,v
retrieving revision 1.1
diff -u -r1.1 category_pathauto.module
--- contrib/category_pathauto/category_pathauto.module	31 Jul 2006 23:22:35 -0000	1.1
+++ contrib/category_pathauto/category_pathauto.module	11 Sep 2006 14:59:09 -0000
@@ -96,7 +96,16 @@
 }
 
 function _category_pathauto_get_path($node, $title = NULL) {
-  $path = category_location($node);
+  // Workaround for possible bug in category_location
+  // If this works, I'll go fix category_location properly.
+  $categories = category_node_get_categories($node->nid);
+  while(!empty($categories)) {
+    $temp = array_shift($categories);
+    $path = category_location((object)array('parent'=>$temp->cid));
+    if(empty($path)) continue; // Couldn't get to the root with this, try with next.
+    break;
+  }
+
   $catpath = array();
 
   foreach ($path as $cat) {
