Skip to content

Commit

Permalink
Work in progress - #172.
Browse files Browse the repository at this point in the history
  • Loading branch information
gjb2048 committed Aug 13, 2023
1 parent d6c3332 commit ea4b55f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions backup/moodle2/restore_format_grid_plugin.class.php
Expand Up @@ -201,11 +201,16 @@ public function process_gridsection($data) {
/* Allow this to process even if not in the grid format so that our event observer on 'course_restored'
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. */

if ($this->step->get_task()->get_target() == backup::TARGET_NEW_COURSE) {
$target = $this->step->get_task()->get_target();
if (($target == backup::TARGET_NEW_COURSE) || ($target == backup::TARGET_CURRENT_DELETING)) {
$courseid = $this->task->get_courseid();
$newsectionid = $this->task->get_sectionid();

if ($target == backup::TARGET_CURRENT_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 ea4b55f

Please sign in to comment.