diff -urp --strip-trailing-cr ../category/category.module ./category.module --- ../category/category.module 2009-08-05 06:52:53.000000000 +0200 +++ ./category.module 2009-10-18 22:16:18.000000000 +0200 @@ -1328,20 +1328,21 @@ function _category_parent_select($catego $exclude = array($category_link['cid']); $parent = $category_link['container']; - // If the container of the current node has an allowed distant parent, then - // generate the list based on the distant container instead of based on the - // actual container. Also exclude the distant container itself from the - // list. - if (!empty($category_link['allowed_parent']) && $category_link['behavior'] == 'category') { - $parent = $category_link['allowed_parent']; - $exclude[] = $category_link['allowed_parent']; - } // If no default parent is given, then set it to the container. - elseif (empty($category_link['parents'])) { + if (empty($category_link['parents'])) { $category_link['parents'] = array($parent); } + $options = category_toc($parent, $exclude, $category_link['parent_depth_limit']); + // If the container of the current node has an allowed distant parent, then + // extend the list based on the distant container. Exclude the distant + // container itself from the list. + if (!empty($category_link['allowed_parent']) && $category_link['behavior'] == 'category') { + $exclude[] = $category_link['allowed_parent']; + $options += category_toc($category_link['allowed_parent'], $exclude, $category_link['parent_depth_limit']); + } + if (!empty($options)) { if ($category_link['original_container'] != $category_link['container'] && $category_link['original_container'] != $category_link['allowed_parent']) { $category_link['parents'] = array(0 => key($options));