Skip to content

Commit

Permalink
MDL-42463 chat: do not set property of cm_info class
Browse files Browse the repository at this point in the history
MDL-41192 made all properties of class cm_info read-only
  • Loading branch information
marinaglancy committed Oct 28, 2013
1 parent 68291f2 commit 55607ef
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions mod/chat/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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 '<div class="head"><div class="date">'.$date.'</div></div>';
echo '<div class="info"><a href="'.$link.'">'.format_string($cm->name,true).'</a></div>';
}
Expand Down Expand Up @@ -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 '<div class="head"><div class="date">'.$date.'</div></div>';
echo '<div class="info"><a href="'.$link.'">'.format_string($cm->name,true).'</a></div>';
Expand Down

0 comments on commit 55607ef

Please sign in to comment.