MDL-74764 core_course: Activity is not in alphabetical order.

This commit is contained in:
Khoa Nguyen Dang
2022-05-27 11:07:38 +07:00
parent b8e9cb31e9
commit 53cc3870e1
@@ -224,11 +224,8 @@ class content_item_service {
$exported = $ciexporter->export($PAGE->get_renderer('core'));
// Sort by title for return.
usort($exported->content_items, function($a, $b) {
return strcmp($a->title, $b->title);
});
return $exported->content_items;
\core_collator::asort_objects_by_property($exported->content_items, 'title');
return array_values($exported->content_items);
}
/**
@@ -300,11 +297,9 @@ class content_item_service {
$exported = $ciexporter->export($PAGE->get_renderer('course'));
// Sort by title for return.
usort($exported->content_items, function($a, $b) {
return strcmp($a->title, $b->title);
});
\core_collator::asort_objects_by_property($exported->content_items, 'title');
return $exported->content_items;
return array_values($exported->content_items);
}
/**