Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
This commit fixes civicrm#4049.

Bug description: When nested tags were not created in the same order as they are nested, they are not shown in the add tag to contact dialog.
  • Loading branch information
gellweiler authored Dec 24, 2022
1 parent 575bb16 commit 28dc4ff
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CRM/Core/BAO/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,18 @@ public function buildTree($usedFor = NULL, $excludeHidden = FALSE) {
$thisref['name'] = $dao->name;
$thisref['description'] = $dao->description;
$thisref['is_selectable'] = $dao->is_selectable;
$thisref['children'] = [];

if (!isset($thisref['children'])) {
$thisref['children'] = [];
}
if (!$dao->parent_id) {
$this->tree[$dao->id] = &$thisref;
}
else {
if (!isset($refs[$dao->parent_id])) {
$refs[$dao->parent_id] = array(
'children' => []
);
}
$refs[$dao->parent_id]['children'][$dao->id] = &$thisref;
}
}
Expand Down

0 comments on commit 28dc4ff

Please sign in to comment.