Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-29450

remove_course_contents() BC and other improvements...

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 2.2
    • 2.0.4, 2.1.1, 2.2
    • Backup, Course, Libraries
    • MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • MOODLE_22_STABLE
    • w47_MDL-29450_m22_removecoursecontent
    • Moderate
    • Hide

      For developers:
      1/ create course, add different activities, user data, grades, etc.
      2/ delete course - look for errors and notices - none expected
      3/ create another course
      4/ delete from PHP script using remove_course_content() wit h the new options
      5/ verify enrolments and groups are kept

      Show
      For developers: 1/ create course, add different activities, user data, grades, etc. 2/ delete course - look for errors and notices - none expected 3/ create another course 4/ delete from PHP script using remove_course_content() wit h the new options 5/ verify enrolments and groups are kept

      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.

            skodak Petr Skoda
            stronk7 Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Rajesh Taneja Rajesh Taneja
            Votes:
            6 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.