Skip to content
Browse files

MDL-29112 trigger event mod_deleted after deleting mod through AJAX

  • Loading branch information...
1 parent 9106716 commit 937e0a23d9f8e0cdcd92df17b8f4931eb5ef8097 @sunner sunner committed with samhemelryk
Showing with 8 additions and 0 deletions.
  1. +8 −0 course/rest.php
View
8 course/rest.php
@@ -209,6 +209,14 @@
error_log("Ajax rest.php: Could not delete the $cm->modname $cm->name from section");
}
+ // Trigger a mod_deleted event with information about this module.
+ $eventdata = new stdClass();
+ $eventdata->modulename = $cm->modname;
+ $eventdata->cmid = $cm->id;
+ $eventdata->courseid = $course->id;
+ $eventdata->userid = $USER->id;
+ events_trigger('mod_deleted', $eventdata);
+
rebuild_course_cache($course->id);
add_to_log($courseid, "course", "delete mod",

0 comments on commit 937e0a2

Please sign in to comment.
Something went wrong with that request. Please try again.