Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-25660 workshop removes its calendar events on instance deletion

  • Loading branch information...
commit ade4de356eecd2c2e3fca7961a6611b8504fc821 1 parent 4494053
@mudrd8mz mudrd8mz authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 mod/workshop/lib.php
View
7 mod/workshop/lib.php
@@ -219,6 +219,13 @@ function workshop_delete_instance($id) {
call_user_func($classname.'::delete_instance', $workshop->id);
}
+ // delete the calendar events
+ $events = $DB->get_records('event', array('modulename' => 'workshop', 'instance' => $workshop->id));
+ foreach ($events as $event) {
+ $event = calendar_event::load($event);
+ $event->delete();
+ }
+
// finally remove the workshop record itself
$DB->delete_records('workshop', array('id' => $workshop->id));
Please sign in to comment.
Something went wrong with that request. Please try again.