Skip to content
Snippets Groups Projects
Commit 3952795a authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

do without sorting, fixes #3639

Closes #3639

Merge request studip/studip!2519
parent 249b5a68
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
/**
......
......@@ -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);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment