mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-29108 Remove all associated grading areas when the context is being deleted
This commit is contained in:
parent
c15b933c69
commit
9e32368b29
2 changed files with 28 additions and 0 deletions
|
@ -4919,6 +4919,10 @@ abstract class context extends stdClass {
|
|||
$fs = get_file_storage();
|
||||
$fs->delete_area_files($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);
|
||||
|
||||
// now delete stuff from role related tables, role_unassign_all
|
||||
// and unenrol should be called earlier to do proper cleanup
|
||||
$DB->delete_records('role_assignments', array('contextid'=>$this->_id));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue