This patch modifies the way copy data is shared in order to mitigate potential race conditions
and ensure that the serialised controller stored in the DB is always in a valid state.
The restore controller is now considered the "source of truth" for all information about the
copy operation. Backup controllers can no longer contain information about course copies.
As copy creation is not atomic, it is still possible for copy controllers to become orphaned or
exist in an invalid state. To mitigate this the backup cleanup task has been modified to call
a new helper method copy_helper::cleanup_orphaned_copy_controllers.
Summary of changes in this patch:
- Copy data must now be passed through the restore controller's constructor
- base_controller::get_copy has been deprecated in favour of restore_controller::get_copy
- base_controller::set_copy has been deprecated without replacement
- core_backup\copy\copy has been deprecated, use copy_helper.class.php's copy_helper instead
- backup_cleanup_task will now clean up orphaned controllers from copy operations that went awry
Thanks to Peter Burnett for assiting with testing this patch.
When a given user doesn't have the capability to "Include user data"
during course copying, freeze the form element rather than not adding
it at all.
This caused problems as the element was required before preceding with
the course copy.
This patch adds better core support for copying courses.
There is now a simplified and dedicated UI for copying
courses. This can be accessed from the course context
menu or course management screens.
All backups are done asynchronously and there can be multiple
copies of a course in flight at once.
Significant string changes:
- configgeneralfiles,core_backup - includes explanation of implications
of settings
- mobilenotificationsdisabledwarning,tool_mobile - location corrected
- statsreport14,core - 'views/posts' corrected to 'posts/views'
- err_nousers,core_completion - explanation of who completion
- information is displayed for errorcourselisting,block_community - note
about sunsetting moodle.net
Allow both UI and automated backups to be created without
including files. Instead include only file references.
This is essentially implementing "SAMESITE" to backup files
instead of only for import and export functionality.
A new backup setting to include files (defaults to yes)
has been included.
The restore process will also look for and attempt to
restore files from the trashdir as part of restoring
backups. Additionally to support this process the
ammount of time files are kept in trashdir before they
are cleaned up via cron is also adjustable via admin
setting.
Significant string changes:
* direct:view,gradeimport_direct - wording corrected from 'CSV' to
'spreadsheet'
* limitanswers_help,mod_choice - additional wording added explaining how
the setting works with groups
* pluginname,customfield_text - 'Text field' plugin renamed to
'Short text'
This patch adds asynchronous backup and restore functionality
to Moodle. This is an optional feature and is not enabled by
default. It can be enabled by site administrators.
Asynchronous backup and restores are actioned by the Moodle
adhoc task API. The progress of backup and restores is
displayedin the Moodle UI. Users can also be sent a message
when a backup or restore operation completes via the
Moodle messaging API.
This commit is part of work on Custom fields API,
to minimize commit history in moodle core the work of a team of developers was split
into several commits with different authors but the authorship of individual
lines of code may be different from the commit author.
Significant string changes:
* completionpass_help, gradetopassnotset in mod_quiz - grade to pass set
in quiz settings not gradebook
* namecolumnmissing,core_cohort - fixing incorrect message about adding
users to a cohort
Changes:
- Add logic to retrieve all the existing current roles.
- Apply the backup's role shortname by matching on the archetype.
- Added backup lang string 'undefinedrolemapping'.