MDL-38314 repository: Delete repository instances on context deletion

This commit is contained in:
Frederic Massart
2013-07-03 16:27:13 +08:00
parent 2bc5ceb31c
commit 6b7b7455d1
2 changed files with 30 additions and 0 deletions
+4
View File
@@ -5284,6 +5284,10 @@ abstract class context extends stdClass implements IteratorAggregate {
$fs = get_file_storage();
$fs->delete_area_files($this->_id);
// Delete all repository instances attached to this context.
require_once($CFG->dirroot . '/repository/lib.php');
repository::delete_all_for_context($this->_id);
// delete all advanced grading data attached to this context
require_once($CFG->dirroot.'/grade/grading/lib.php');
grading_manager::delete_all_for_context($this->_id);