MDL-59823 users: Enrol bulk op course instance
The commit message above was my best attempt at meeting the very short restrictions on commit message first lines. What it needed to say was: "Only show bulk enrolment operations for enrolment methods that have an instance in the course"
This commit is contained in:
+1
-1
@@ -554,7 +554,7 @@ class course_enrolment_manager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all of the enrolment plugins that are active for this course.
|
||||
* Gets all of the enrolment plugins that are available for this course.
|
||||
*
|
||||
* @param bool $onlyenabled return only enabled enrol plugins
|
||||
* @return array
|
||||
|
||||
+8
-2
@@ -254,8 +254,14 @@ if ($bulkoperations) {
|
||||
}
|
||||
|
||||
if ($context->id != $frontpagectx->id) {
|
||||
$plugins = $manager->get_enrolment_plugins();
|
||||
foreach ($plugins as $plugin) {
|
||||
$instances = $manager->get_enrolment_instances();
|
||||
$plugins = $manager->get_enrolment_plugins(false);
|
||||
foreach ($instances as $key => $instance) {
|
||||
if (!isset($plugins[$instance->enrol])) {
|
||||
// Weird, some broken stuff in plugin.
|
||||
continue;
|
||||
}
|
||||
$plugin = $plugins[$instance->enrol];
|
||||
$bulkoperations = $plugin->get_bulk_operations($manager);
|
||||
|
||||
$pluginoptions = [];
|
||||
|
||||
Reference in New Issue
Block a user