Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-28643 Fix debugging message when deleting activity with grade com…

…pletion
  • Loading branch information...
commit ad275cb4adee492b51e66e10af13b5a2e9982e73 1 parent 3fdc622
@sammarshallou sammarshallou authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/grade/grade_grade.php
View
12 lib/grade/grade_grade.php
@@ -794,10 +794,16 @@ function notify_changed($deleted) {
// Get course-module
$cm = get_coursemodule_from_instance($this->grade_item->itemmodule,
$this->grade_item->iteminstance, $this->grade_item->courseid);
+ // If the course-module doesn't exist, display a warning...
if (!$cm) {
- debugging("Couldn't find course-module for module
- '{$this->grade_item->itemmodule}', instance '{$this->grade_item->iteminstance}',
- course '{$this->grade_item->courseid}'");
+ // ...unless the grade is being deleted in which case it's likely
+ // that the course-module was just deleted too, so that's okay.
+ if (!$deleted) {
+ debugging("Couldn't find course-module for module '" .
+ $this->grade_item->itemmodule . "', instance '" .
+ $this->grade_item->iteminstance . "', course '" .
+ $this->grade_item->courseid . "'");
+ }
return;
}
Please sign in to comment.
Something went wrong with that request. Please try again.