Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-29112 trigger event mod_deleted after deleting mod through AJAX

  • Loading branch information...
commit c5234aa1d9707ecf8a926724cecb4f02c65a5f0b 1 parent 16ff2ae
@sunner sunner authored samhemelryk committed
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",
Please sign in to comment.
Something went wrong with that request. Please try again.