mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
merged from MOODLE_17_STABLE: fixing MDL-8662
This commit is contained in:
parent
71989c5d39
commit
1c7166a8d4
1 changed files with 2 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue