From 70b5660a5178ad19966cbf3c33236d1aca81101f Mon Sep 17 00:00:00 2001 From: skodak Date: Wed, 18 Oct 2006 21:02:30 +0000 Subject: [PATCH] fixed Notices after assignment deletion in Recent Activity MDL-7089 ; merged from MOODLE_17_STABLE --- mod/assignment/lib.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index 7e3f1b1181..d911e3b9a5 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -1988,7 +1988,7 @@ function assignment_print_recent_activity($course, $isteacher, $timestart) { global $CFG; $content = false; - $assignments = NULL; + $assignments = array(); if (!$logs = get_records_select('log', 'time > \''.$timestart.'\' AND '. 'course = \''.$course->id.'\' AND '. @@ -1999,6 +1999,7 @@ function assignment_print_recent_activity($course, $isteacher, $timestart) { foreach ($logs as $log) { //Create a temp valid module structure (course,id) + $tempmod = new object(); $tempmod->course = $log->course; $tempmod->id = $log->info; //Obtain the visible property from the instance @@ -2006,13 +2007,15 @@ function assignment_print_recent_activity($course, $isteacher, $timestart) { //Only if the mod is visible if ($modvisible) { - $assignments[$log->info] = assignment_log_info($log); - $assignments[$log->info]->time = $log->time; - $assignments[$log->info]->url = str_replace('&', '&', $log->url); + if ($info = assignment_log_info($log)) { + $assignments[$log->info] = $info; + $assignments[$log->info]->time = $log->time; + $assignments[$log->info]->url = str_replace('&', '&', $log->url); + } } } - if ($assignments) { + if (!empty($assignments)) { print_headline(get_string('newsubmissions', 'assignment').':'); foreach ($assignments as $assignment) { print_recent_activity_note($assignment->time, $assignment, $assignment->name, -- 2.39.5