When we import courses or duplicate activities, the deduplicating nature of
the file_storage system means that we don't actually have to include the
real files in the backup - just their metadata from the file table.
The restoration process needs to know not to expect files from the backup
phase so a flag is set in moodle_backup metadata.
This patch fixes:
* missing enrolment methods after 1.9 backup restore - defaults are added
* enrolment methods are restored only when users option is enabled
* manual enrolment override option is disabled if users not available
- Fields added to format_legacy as default course format options;
- Upgrade script copies fields values from table course to course_format_options;
- Fields removed from table course;
- Fields removed from edit course form;
- Since front-page course has a 'numsections' setting, format_site defines it as it's option;
- Removed accessing those fields in core code unless we know that format supports them and in this
case instead of $course = $DB->get_record('course'); we use:
$course = course_get_format($courseorid)->get_course(); This way all format-specific options
are added to the $course object
This patch includes following changes and new features:
* Group sync in enrol_cohort plugin.
* Option for editing of role in existing cohort sync instance.
* Group memberships are now restored after enrolments.
* New enrol method for restore of protected group membership.
* New component callback 'restore_group_member' for restore of general plugin group membership.
* New component callback 'restore_role_assignment' for restore of general plugin role assignments.
* Implemented group membership protection in enrolment UI.
* Other minor fixes and cleanup.
Notes:
* The YUI base enrolment page is not reimplemented yet - see MDL-35618.
On backup, contents are cleaned to be safe utf8. That was leading to
some matching problems on restore against not cleaned DB contents (for
already existing questions). This commit adds one fallback method to
perform the match against cleaned DB contents.
Includes option to convert all enrolments to enrol_manual instances, support for mapping of custom fields and fixes for several other problems. This does not include support for custom enrol tables, it will be addressed in another issue.