From 55607effe1ae34250d2c1cb19239dbd94230a16e Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Tue, 22 Oct 2013 19:58:11 +1100 Subject: [PATCH] MDL-42463 chat: do not set property of cm_info class MDL-41192 made all properties of class cm_info read-only --- mod/chat/lib.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mod/chat/lib.php b/mod/chat/lib.php index b48df088600..c51d33ee34e 100644 --- a/mod/chat/lib.php +++ b/mod/chat/lib.php @@ -274,14 +274,13 @@ function chat_print_recent_activity($course, $viewfullnames, $timestart) { continue; } $cm = $modinfo->cms[$cmid]; - $cm->lasttime = $mcm->lasttime; if (!$modinfo->cms[$cm->id]->uservisible) { continue; } if (groups_get_activity_groupmode($cm) != SEPARATEGROUPS or has_capability('moodle/site:accessallgroups', context_module::instance($cm->id))) { - if ($timeout > time() - $cm->lasttime) { + if ($timeout > time() - $mcm->lasttime) { $current[] = $cm; } else { $past[] = $cm; @@ -314,8 +313,8 @@ function chat_print_recent_activity($course, $viewfullnames, $timestart) { continue; } - $cm->lasttime = $mcm->lasttime; - if ($timeout > time() - $cm->lasttime) { + $mcms[$cmid]->lasttime = $mcm->lasttime; + if ($timeout > time() - $mcm->lasttime) { $current[] = $cm; } else { $past[] = $cm; @@ -333,7 +332,7 @@ function chat_print_recent_activity($course, $viewfullnames, $timestart) { foreach ($past as $cm) { $link = $CFG->wwwroot.'/mod/chat/view.php?id='.$cm->id; - $date = userdate($cm->lasttime, $strftimerecent); + $date = userdate($mcms[$cm->id]->lasttime, $strftimerecent); echo '
'.$date.'
'; echo '
'.format_string($cm->name,true).'
'; } @@ -371,7 +370,7 @@ function chat_print_recent_activity($course, $viewfullnames, $timestart) { } $link = $CFG->wwwroot.'/mod/chat/view.php?id='.$cm->id; - $date = userdate($cm->lasttime, $strftimerecent); + $date = userdate($mcms[$cm->id]->lasttime, $strftimerecent); echo '
'.$date.'
'; echo '
'.format_string($cm->name,true).'
';