-
Bug
-
Resolution: Fixed
-
Critical
-
2.0.4, 2.1.1, 2.2
-
MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
-
MOODLE_22_STABLE
-
w47_
MDL-29450_m22_removecoursecontent -
Moderate
-
Before 1.9 the remove_course_contents() used to keep the course role-assignments (old enrolments) unmodified.
But that changed without notice in in 2.0 and now the function in in charge of deleting both role-assingments and enrolment methods.
Right now that function is only used in core by:
- delete_course()
- restore, where restoring into existing course, deleting contents.
And it's in the 2nd use (restore), where the change is causing unexpected results (compared with the same restore option in 1.9). See MDL-27233.
So this is one proposal to add some new param (or array of params) to be able to avoid deleting certain parts, say modules, blocks, groups, groupings, role assignments, enrolment methods... call it: $options = array().
Note that we really only need to avoid deleting role_assignments and enrolment methods and surely one simple param could be enough. Just thinking the array alternative could be easy for expansion later.