#74976 by RobRoy and mrgeneyuss. Clone category objects for multi-parent heirarchy.
parent
6b3775c90d
commit
6d3ab3e030
|
@ -913,11 +913,12 @@ function taxonomy_get_tree($vid, $parent = 0, $depth = -1, $max_depth = NULL) {
|
|||
if ($children[$vid][$parent]) {
|
||||
foreach ($children[$vid][$parent] as $child) {
|
||||
if ($max_depth > $depth) {
|
||||
$terms[$vid][$child]->depth = $depth;
|
||||
$term = drupal_clone($terms[$vid][$child]);
|
||||
$term->depth = $depth;
|
||||
// The "parent" attribute is not useful, as it would show one parent only.
|
||||
unset($terms[$vid][$child]->parent);
|
||||
$terms[$vid][$child]->parents = $parents[$vid][$child];
|
||||
$tree[] = $terms[$vid][$child];
|
||||
unset($term->parent);
|
||||
$term->parents = $parents[$vid][$child];
|
||||
$tree[] = $term;
|
||||
|
||||
if ($children[$vid][$child]) {
|
||||
$tree = array_merge($tree, taxonomy_get_tree($vid, $child, $depth, $max_depth));
|
||||
|
|
Loading…
Reference in New Issue