mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-30951 prevent fatal error when category sync enrolment not configured
This commit is contained in:
parent
2117dcb591
commit
c2d6b4f9ce
@ -99,7 +99,9 @@ class enrol_category_handler {
|
||||
|
||||
// now this is going to be a bit slow, take all enrolments in child courses and verify each separately
|
||||
$syscontext = get_context_instance(CONTEXT_SYSTEM);
|
||||
$roles = get_roles_with_capability('enrol/category:synchronised', CAP_ALLOW, $syscontext);
|
||||
if (!$roles = get_roles_with_capability('enrol/category:synchronised', CAP_ALLOW, $syscontext)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$plugin = enrol_get_plugin('category');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user