Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixing MDL-8662

  • Loading branch information...
commit d550a1409b8a35b1ae62765445f8006d11bade38 1 parent e56a129
mjollnir_ authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/statslib.php
4 lib/statslib.php
View
@@ -132,7 +132,7 @@ function stats_cron_daily () {
}
}
- $context = get_record('context','instanceid',$course->id,'contextlevel',CONTEXT_COURSE);
+ $context = get_context_instance(CONTEXT_COURSE, $course->id);
if (!$roles = get_roles_on_exact_context($context)) {
// no roles.. nothing to log.
continue;
@@ -954,7 +954,7 @@ function stats_get_report_options($courseid,$mode) {
switch ($mode) {
case STATS_MODE_GENERAL:
$reportoptions[STATS_REPORT_ACTIVITY] = get_string('statsreport'.STATS_REPORT_ACTIVITY);
- if ($courseid != SITEID && $context = get_record('context','instanceid',$courseid,'contextlevel',CONTEXT_COURSE)) {
+ if ($courseid != SITEID && $context = get_context_instance(CONTEXT_COURSE, $courseid)) {
$sql = 'SELECT r.id,r.name FROM '.$CFG->prefix.'role r JOIN '.$CFG->prefix.'stats_daily s ON s.roleid = r.id WHERE s.courseid = '.$courseid;
if ($roles = get_records_sql($sql)) {
foreach ($roles as $role) {
Please sign in to comment.
Something went wrong with that request. Please try again.