MDL-38314 repository: Delete repository instances on context deletion

This commit is contained in:
Frederic Massart
2013-07-03 16:27:08 +08:00
parent c11ea21997
commit d8732ee8b7
2 changed files with 30 additions and 0 deletions
+4
View File
@@ -5249,6 +5249,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);