diff --git a/lib/models/RangeTreeNode.php b/lib/models/RangeTreeNode.php index 29d4bcdabd91afa8b09e62f9e5b730869220e673..ebd6cc0df4e7955b0885e545092ef7aa2faa689b 100644 --- a/lib/models/RangeTreeNode.php +++ b/lib/models/RangeTreeNode.php @@ -114,7 +114,7 @@ class RangeTreeNode extends SimpleORMap implements StudipTreeNode */ public function getChildNodes(bool $onlyVisible = false): array { - return self::findByParent_id($this->id, "ORDER BY `priority`, `name`"); + return self::findByParent_id($this->id); } /** diff --git a/lib/models/StudipStudyArea.php b/lib/models/StudipStudyArea.php index 8da8e169262bb43ea6a0f62babc653ff2d9e5c52..6c3f5821f2dafb825475816abe4783b83765cee1 100644 --- a/lib/models/StudipStudyArea.php +++ b/lib/models/StudipStudyArea.php @@ -465,16 +465,16 @@ class StudipStudyArea extends SimpleORMap implements StudipTreeNode public function getChildNodes(bool $onlyVisible = false): array { if ($onlyVisible) { - $visibleTypes = array_filter($GLOBALS['SEM_TREE_TYPES'], function ($t) { - return isset($t['hidden']) ? !$t['hidden'] : true; + $visibleTypes = array_filter($GLOBALS['SEM_TREE_TYPES'], function ($t): bool { + return empty($t['hidden']); }); return static::findBySQL( - "`parent_id` = :parent AND `type` IN (:types) ORDER BY `priority`, `name`", + "`parent_id` = :parent AND `type` IN (:types)", ['parent' => $this->id, 'types' => $visibleTypes] ); } else { - return static::findByParent_id($this->id, "ORDER BY `priority`, `name`"); + return static::findByParent_id($this->id); } }