MDL-87433 course: Add sorting to get_nearest_editable_subcategory

Add ORDER BY to the query to ensure categories are returned in
consistent order. This fixes random test failures, especially
on PostgreSQL.
This commit is contained in:
Muhammad Arnaldo
2025-12-24 16:14:19 +07:00
parent 1cd17816c5
commit c04a71b431
+1
View File
@@ -3263,6 +3263,7 @@ class core_course_category implements renderable, cacheable_object, IteratorAggr
ON uc.roleid = rc.roleid
AND ( $eqpaths OR $likechild )
WHERE (ra.id IS NOT NULL OR uc.upath IS NOT NULL)
ORDER BY cc.sortorder, cc.id
";
$params = [