Skip to content

Commit

Permalink
MDL-30951 prevent fatal error when category sync enrolment not config…
Browse files Browse the repository at this point in the history
…ured
  • Loading branch information
skodak committed Jan 1, 2012
1 parent 2117dcb commit c2d6b4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion enrol/category/locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit c2d6b4f

Please sign in to comment.