Permalink
Browse files

course completion: MDL-2631 Prevent error when no roles are available

  • Loading branch information...
1 parent 0e4f7b4 commit c919b26d7eda222fc1ac5c0012e6b04b3ca6c04f @srynot4sale srynot4sale committed Aug 4, 2010
Showing with 4 additions and 0 deletions.
  1. +4 −0 course/completion.php
@@ -132,6 +132,10 @@
$aggregation->insert();
// Role aggregation
+ if (empty($data->role_aggregation)) {
+ $data->role_aggregation = 0;
+ }
+
$aggregation = new completion_aggregation();
$aggregation->course = $data->id;
$aggregation->criteriatype = COMPLETION_CRITERIA_TYPE_ROLE;

0 comments on commit c919b26

Please sign in to comment.