MDL-31790 prevent removing of protected role assignments from subcontexts

This commit is contained in:
Petr Skoda
2012-03-13 12:30:13 +01:00
parent 35c89e5e87
commit 5b8a9d1329
+1 -1
View File
@@ -4546,7 +4546,7 @@ function remove_course_contents($courseid, $showfeedback = true, array $options
// Remove all roles and enrolments by default
if (empty($options['keep_roles_and_enrolments'])) {
// this hack is used in restore when deleting contents of existing course
role_unassign_all(array('contextid'=>$coursecontext->id), true);
role_unassign_all(array('contextid'=>$coursecontext->id, 'component'=>''), true);
enrol_course_delete($course);
if ($showfeedback) {
echo $OUTPUT->notification($strdeleted.get_string('type_enrol_plural', 'plugin'), 'notifysuccess');