mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
fixed category sync cleanup
This commit is contained in:
parent
894843b465
commit
ac86edd01a
1 changed files with 3 additions and 1 deletions
|
@ -250,9 +250,11 @@ function enrol_category_sync_full() {
|
||||||
if (!$roles = get_roles_with_capability('enrol/category:synchronised', CAP_ALLOW, $syscontext)) {
|
if (!$roles = get_roles_with_capability('enrol/category:synchronised', CAP_ALLOW, $syscontext)) {
|
||||||
// yay, nothing to do, so let's remove all leftovers
|
// yay, nothing to do, so let's remove all leftovers
|
||||||
if ($instances = $DB->get_records('enrol', array('enrol'=>'category'))) {
|
if ($instances = $DB->get_records('enrol', array('enrol'=>'category'))) {
|
||||||
|
foreach ($instances as $instance) {
|
||||||
$plugin->delete_instance($instance);
|
$plugin->delete_instance($instance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
list($roleids, $params) = $DB->get_in_or_equal(array_keys($roles), SQL_PARAMS_NAMED, 'r000');
|
list($roleids, $params) = $DB->get_in_or_equal(array_keys($roles), SQL_PARAMS_NAMED, 'r000');
|
||||||
$params['courselevel'] = CONTEXT_COURSE;
|
$params['courselevel'] = CONTEXT_COURSE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue