Skip to content

Commit

Permalink
Finished? - #172.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Aug 11, 2023
1 parent 89f7d71 commit b4e21f3
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions backup/moodle2/restore_format_grid_plugin.class.php
Expand Up @@ -39,6 +39,7 @@ class restore_format_grid_plugin extends restore_format_plugin {

/**
* Returns the paths to be handled by the plugin at course level.
* I think this is only called when the course format settings change.
*/
protected function define_course_plugin_structure() {
/* Since this method is executed before the restore we can do some pre-checks here.
Expand Down Expand Up @@ -93,18 +94,6 @@ public function process_grid($data) {
// No need to annotate anything here.
}

protected function after_execute_structure() {
error_log("after_execute_structure");
}

protected function after_execute_course() {
error_log("after_execute_course");
}

protected function after_restore_structure() {
error_log("after_restore_structure");
}

/**
* Executed after course restore is complete
*
Expand Down Expand Up @@ -212,15 +201,12 @@ public function process_gridsection($data) {
can perform a clean up of restored grid image files after all the data is in place in the database
for this to happen properly. */
$target = $this->step->get_task()->get_target();
if (($target == backup::TARGET_NEW_COURSE) || ($target == backup::TARGET_EXISTING_DELETING)) {
if (($target == backup::TARGET_NEW_COURSE) ||
($target == backup::TARGET_CURRENT_DELETING) ||
($target == backup::TARGET_EXISTING_DELETING)) {
$courseid = $this->task->get_courseid();
$newsectionid = $this->task->get_sectionid();

/*if ($target == backup::TARGET_EXISTING_DELETING) {
// Delete any images associated with the target course.
\format_grid\toolbox::delete_images($courseid);
}*/

if (empty($data->contenthash)) {
// Less than M4.0 backup file.
if (!empty($data->imagepath)) {
Expand Down

0 comments on commit b4e21f3

Please sign in to comment.