Skip to content

Commit

Permalink
The categories ancestors are displayed in the wrong order when there …
Browse files Browse the repository at this point in the history
…are disabled for child entities. see #5409
  • Loading branch information
tsmr committed Jul 10, 2015
1 parent 9c5e40a commit f7b0090
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ajax/getDropdownValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@

$work_level = $level-1;
$work_parentID = $data[$item->getForeignKeyField()];

$parent_datas = array();
do {
// Get parent
if ($item->getFromDB($work_parentID)) {
Expand Down Expand Up @@ -350,7 +350,7 @@
if ($_GET['permit_select_parent']) {
unset($temp['disabled']);
}
array_push($datastoadd, $temp);
array_unshift($parent_datas, $temp);
}
$last_level_displayed[$work_level] = $item->fields['id'];
$work_level--;
Expand All @@ -363,7 +363,10 @@
} while (($work_level >= 1)
&& (!isset($last_level_displayed[$work_level])
|| ($last_level_displayed[$work_level] != $work_parentID)));

// Add parents
foreach($parent_datas as $val){
array_push($datastoadd, $val);
}
}
}
$last_level_displayed[$level] = $data['id'];
Expand Down

0 comments on commit f7b0090

Please sign in to comment.