mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
MDL-35899 fix cohort sorting in enrol UI
This commit is contained in:
parent
ca48fe5f97
commit
a069c3f76a
@ -77,6 +77,8 @@ switch ($action) {
|
||||
$offset = optional_param('offset', 0, PARAM_INT);
|
||||
$search = optional_param('search', '', PARAM_RAW);
|
||||
$outcome->response = enrol_cohort_search_cohorts($manager, $offset, 25, $search);
|
||||
// Some browsers reorder collections by key.
|
||||
$outcome->response['cohorts'] = array_values($outcome->response['cohorts']);
|
||||
break;
|
||||
case 'enrolcohort':
|
||||
require_capability('moodle/course:enrolconfig', $context);
|
||||
|
@ -229,7 +229,7 @@ YUI.add('moodle-enrol_cohort-quickenrolment', function(Y) {
|
||||
var rawcohorts = response.cohorts;
|
||||
var cohorts = [], i=0;
|
||||
for (i in rawcohorts) {
|
||||
cohorts[rawcohorts[i].cohortid] = new COHORT(rawcohorts[i]);
|
||||
cohorts[i] = new COHORT(rawcohorts[i]);
|
||||
}
|
||||
this.set(COHORTS, cohorts);
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user