From e6e9bec3ee9a10091a4a8873d743590e79801855 Mon Sep 17 00:00:00 2001 From: Andreas Grabs Date: Thu, 30 May 2013 23:10:33 +0200 Subject: [PATCH] MDL-39932 mod_feedback - Mapping Feedback when Course is Deleted - thx to David N. Johnson --- mod/feedback/mapcourse.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mod/feedback/mapcourse.php b/mod/feedback/mapcourse.php index 4e0d669c574..ba33874b9cd 100644 --- a/mod/feedback/mapcourse.php +++ b/mod/feedback/mapcourse.php @@ -68,6 +68,7 @@ require_login($course, true, $cm); require_capability('mod/feedback:mapcourse', $context); if ($coursefilter) { + $map = new stdClass; $map->feedbackid = $feedback->id; $map->courseid = $coursefilter; // insert a map only if it does exists yet @@ -123,6 +124,7 @@ echo ''; if ($coursemap = feedback_get_courses_from_sitecourse_map($feedback->id)) { $table = new flexible_table('coursemaps'); + $table->baseurl = $url; $table->define_columns( array('course')); $table->define_headers( array(get_string('mappedcourses', 'feedback'))); @@ -130,9 +132,8 @@ if ($coursemap = feedback_get_courses_from_sitecourse_map($feedback->id)) { $unmapurl = new moodle_url('/mod/feedback/unmapcourse.php'); foreach ($coursemap as $cmap) { - $cmapcontext = context_course::instance($cmap->id); - $cmapshortname = format_string($cmap->shortname, true, array('context' => $cmapcontext)); $coursecontext = context_course::instance($cmap->courseid); + $cmapshortname = format_string($cmap->shortname, true, array('context' => $coursecontext)); $cmapfullname = format_string($cmap->fullname, true, array('context' => $coursecontext)); $unmapurl->params(array('id'=>$id, 'cmapid'=>$cmap->id)); $anker = '';