From 2be2c4c2cd3afb831a5108a0eeacfb2108afa248 Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 17 Feb 2008 18:38:44 +0000 Subject: [PATCH] MDL-12934 temporary fix for grade items of activities without proper course module record; merged from MOODLE_19_STABLE --- grade/lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grade/lib.php b/grade/lib.php index 7e8e834a90..2a3becfbee 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -852,7 +852,9 @@ class grade_structure { $iteminstance = $element['object']->iteminstance; if ($withlink and $itemtype=='mod' and $iteminstance and $itemmodule) { - $cm = get_coursemodule_from_instance($itemmodule, $iteminstance, $this->courseid); + if (!$cm = get_coursemodule_from_instance($itemmodule, $iteminstance, $this->courseid)) { + continue; + } $dir = $CFG->dirroot.'/mod/'.$itemmodule; -- 2.39.5