mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-22051, move comments deletion code to accesslib.php
This commit is contained in:
parent
472c1022d6
commit
ec125c7596
2 changed files with 2 additions and 4 deletions
|
@ -1923,6 +1923,8 @@ function delete_context($contextlevel, $instanceid) {
|
||||||
|
|
||||||
blocks_delete_all_for_context($context->id);
|
blocks_delete_all_for_context($context->id);
|
||||||
filter_delete_all_for_context($context->id);
|
filter_delete_all_for_context($context->id);
|
||||||
|
require_once($CFG->dirroot . '/comment/lib.php');
|
||||||
|
comment::delete_comments(array('contextid'=>$context->id));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -4189,10 +4189,6 @@ function remove_course_contents($courseid, $showfeedback=true) {
|
||||||
require_once($CFG->dirroot.'/tag/coursetagslib.php');
|
require_once($CFG->dirroot.'/tag/coursetagslib.php');
|
||||||
coursetag_delete_course_tags($course->id, $showfeedback);
|
coursetag_delete_course_tags($course->id, $showfeedback);
|
||||||
|
|
||||||
/// Delete comments
|
|
||||||
require_once($CFG->dirroot.'/comment/lib.php');
|
|
||||||
comment::delete_comments(array('contextid'=>$context->id));
|
|
||||||
|
|
||||||
// Delete legacy files
|
// Delete legacy files
|
||||||
fulldelete($CFG->dataroot.'/'.$courseid);
|
fulldelete($CFG->dataroot.'/'.$courseid);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue