Skip to content
Browse files

Merge branch 'MDL-25936_wip' of git://github.com/skodak/moodle

  • Loading branch information...
2 parents bec662a + 4cb0242 commit 242c4319ab9f4640f58f9f7caee9748c6a6043b8 @samhemelryk samhemelryk committed
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;
+ }
+ }
+ }
}
}

0 comments on commit 242c431

Please sign in to comment.
Something went wrong with that request. Please try again.