Skip to content

Commit

Permalink
Merge branch 'MDL-74764-311' of https://github.com/BruceGoodGuy/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_311_STABLE
  • Loading branch information
andrewnicols authored and sarjona committed Jun 10, 2022
2 parents f83929a + 53cc387 commit 21f4357
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions course/classes/local/service/content_item_service.php
Expand Up @@ -224,11 +224,8 @@ private function export_content_items(\stdClass $user, $contentitems) {
$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);
}

/**
Expand Down Expand Up @@ -300,11 +297,9 @@ public function get_content_items_for_user_in_course(\stdClass $user, \stdClass
$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);
}

/**
Expand Down

0 comments on commit 21f4357

Please sign in to comment.