MDL-69687 Course: Improve removal of completion data on MySQL
This commit is contained in:
+2
-3
@@ -5327,9 +5327,8 @@ function remove_course_contents($courseid, $showfeedback = true, array $options
|
||||
// Remove all data from availability and completion tables that is associated
|
||||
// with course-modules belonging to this course. Note this is done even if the
|
||||
// features are not enabled now, in case they were enabled previously.
|
||||
$DB->delete_records_select('course_modules_completion',
|
||||
'coursemoduleid IN (SELECT id from {course_modules} WHERE course=?)',
|
||||
array($courseid));
|
||||
$DB->delete_records_subquery('course_modules_completion', 'coursemoduleid', 'id',
|
||||
'SELECT id from {course_modules} WHERE course = ?', [$courseid]);
|
||||
|
||||
// Remove course-module data that has not been removed in modules' _delete_instance callbacks.
|
||||
$cms = $DB->get_records('course_modules', array('course' => $course->id));
|
||||
|
||||
Reference in New Issue
Block a user