mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-59890 calendar: Delete category events upon category removal
This commit is contained in:
parent
d0e56d847a
commit
74475e5bb4
@ -1756,6 +1756,9 @@ class coursecat implements renderable, cacheable_object, IteratorAggregate {
|
||||
throw new moodle_exception('cannotdeletecategoryquestions', '', '', $this->get_formatted_name());
|
||||
}
|
||||
|
||||
// Delete all events in the category.
|
||||
$DB->delete_records('event', array('categoryid' => $this->id));
|
||||
|
||||
// Finally delete the category and it's context.
|
||||
$DB->delete_records('course_categories', array('id' => $this->id));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user