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 15:47:54 +07:00
parent 8316779bd9
commit e8f04c19a3
+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 = [