diff --git a/course/externallib.php b/course/externallib.php index 71c24a0d595..7a7d24567d2 100644 --- a/course/externallib.php +++ b/course/externallib.php @@ -1028,7 +1028,7 @@ class core_course_external extends external_api { // Check if we need to unzip the file because the backup temp dir does not contains backup files. if (!file_exists($backupbasepath . "/moodle_backup.xml")) { - $file->extract_to_pathname(get_file_packer(), $backupbasepath); + $file->extract_to_pathname(get_file_packer('application/vnd.moodle.backup'), $backupbasepath); } // Create new course. diff --git a/course/tests/courselib_test.php b/course/tests/courselib_test.php index 9c38afe3b2f..b60e5ac604a 100644 --- a/course/tests/courselib_test.php +++ b/course/tests/courselib_test.php @@ -1726,7 +1726,7 @@ class core_course_courselib_testcase extends advanced_testcase { $bc->execute_plan(); $results = $bc->get_results(); $file = $results['backup_destination']; - $fp = get_file_packer(); + $fp = get_file_packer('application/vnd.moodle.backup'); $filepath = $CFG->dataroot . '/temp/backup/test-restore-course-event'; $file->extract_to_pathname($fp, $filepath); $bc->destroy(); diff --git a/lib/tests/questionlib_test.php b/lib/tests/questionlib_test.php index 10b4007a031..94bb71e12d7 100644 --- a/lib/tests/questionlib_test.php +++ b/lib/tests/questionlib_test.php @@ -186,7 +186,7 @@ class core_questionlib_testcase extends advanced_testcase { $bc->execute_plan(); $results = $bc->get_results(); $file = $results['backup_destination']; - $fp = get_file_packer(); + $fp = get_file_packer('application/vnd.moodle.backup'); $filepath = $CFG->dataroot . '/temp/backup/test-restore-course'; $file->extract_to_pathname($fp, $filepath); $bc->destroy();