MDL-83479 backup: Added upgrade notes.

Also some small tweaks to address comments.
This commit is contained in:
Jason Den Dulk 2025-02-13 12:36:20 +11:00
parent 7eb9cd0e8b
commit c4335a8e0e
3 changed files with 22 additions and 10 deletions

View File

@ -0,0 +1,12 @@
issueNumber: MDL-83479
notes:
core_backup:
- message: >-
Added several hooks to the restore process to 1) Hook to allow extra settings to be defined for the course
restore process. 2) Hook to allow adding extra fields to the copy course form. 3) Hook used by
copy_helper::process_formdata() to expand the list of required fields. 4) Hook used to allow interaction with
the copy task, before the actual task execution takes place.
Other changes include 1) base_task::add_setting() is now public to allow hook callbacks to add settings.
2) Settings are now added to the data sent to the course_restored event.
type: improved

View File

@ -43,7 +43,7 @@ final class copy_helper {
'fullname', // Fullname of the destination course.
'shortname', // Shortname of the destination course.
'category', // Category integer ID that contains the destination course.
'visible', // Integer to determine of the copied course will be visible.
'visible', // Integer to detrmine of the copied course will be visible.
'startdate', // Integer timestamp of the start of the destination course.
'enddate', // Integer timestamp of the end of the destination course.
'idnumber', // ID of the destination course.

View File

@ -270,6 +270,15 @@ abstract class base_task implements checksumable, executable, loggable {
}
}
// Protected API starts here
/**
* This function is invoked on activity creation in order to add all the settings
* that are associated with one task. The function will, directly, inject the settings
* in the task.
*/
abstract protected function define_settings();
/**
* Add a setting to the task.
*
@ -282,15 +291,6 @@ abstract class base_task implements checksumable, executable, loggable {
}
$this->settings[] = $setting;
}
// Protected API starts here
/**
* This function is invoked on activity creation in order to add all the settings
* that are associated with one task. The function will, directly, inject the settings
* in the task.
*/
abstract protected function define_settings();
}
/*