Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-25936 fixed user upload when manual plugin not first

  • Loading branch information...
commit 4cb02426ff0ecc4f917ea9812ba96022eaa2feb8 1 parent 5a7f931
@skodak skodak authored
Showing with 10 additions and 4 deletions.
  1. +10 −4 admin/uploaduser.php
View
14 admin/uploaduser.php
@@ -668,10 +668,16 @@
$courseid = $ccache[$shortname]->id;
$coursecontext = get_context_instance(CONTEXT_COURSE, $courseid);
if (!isset($manualcache[$courseid])) {
- if ($instances = enrol_get_instances($courseid, false)) {
- $manualcache[$courseid] = reset($instances);
- } else {
- $manualcache[$courseid] = false;
+ $manualcache[$courseid] = false;
+ if ($manual) {
+ if ($instances = enrol_get_instances($courseid, false)) {
+ foreach ($instances as $instance) {
+ if ($instance->enrol === 'manual') {
+ $manualcache[$courseid] = $instance;
+ break;
+ }
+ }
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.