Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-30951 prevent fatal error when category sync enrolment not config…

…ured
  • Loading branch information...
commit 8be58774cdc34b89aad6ffa43c65b47626d5bf91 1 parent ffbcd68
@skodak skodak authored stronk7 committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 enrol/category/locallib.php
View
4 enrol/category/locallib.php
@@ -99,7 +99,9 @@ public function role_unassigned($ra) {
// 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');
Please sign in to comment.
Something went wrong with that request. Please try again.