--- c:\temp\TCV339e.tmp\category.1.1.inc Tue Aug 15 16:14:24 2006 +++ category.inc Tue Aug 15 16:09:55 2006 @@ -212,6 +212,7 @@ /** * Find all parents of a given category ID. + * This function will return the parents in an indexed array sorted by the parents' weight and title. */ function category_get_parents($cid, $key = 'cid', $distant = TRUE, $reset = FALSE) { static $parents, $distant_parents; @@ -234,10 +235,10 @@ $parent->admin_title = $parent->title; } if ($distant) { - $distant_parents[$parent->child][$parent->$key] = $parent; + $distant_parents[$parent->child][] = $parent; } else { - $parents[$parent->child][$parent->$key] = $parent; + $parents[$parent->child][] = $parent; } } } @@ -1236,7 +1237,11 @@ $default_parent = 0; if ($node->nid || $node->cnid) { - $parents = array_keys(category_get_parents($node->nid)); + $parents = category_get_parents($node->nid); + for($i=0;$icid; + } + $hierarchy = $is_cat ? (isset($node->hierarchy) ? $node->hierarchy : 1) : variable_get('category_distant_containers', 1); // This makes the parent element have all possible options on submit,