MDL-35773 tool_recyclebin: ensure backups always contain files
authorMark Nelson <mdjnelson@gmail.com>
Wed, 10 Jul 2019 04:40:33 +0000 (12:40 +0800)
committerMark Nelson <mdjnelson@gmail.com>
Fri, 26 Jul 2019 03:59:57 +0000 (11:59 +0800)
admin/tool/recyclebin/classes/category_bin.php
admin/tool/recyclebin/classes/course_bin.php

index 6477c4d..b5bde99 100644 (file)
@@ -109,14 +109,15 @@ class category_bin extends base_bin {
         require_once($CFG->dirroot . '/backup/util/includes/backup_includes.php');
 
         // As far as recycle bin is using MODE_AUTOMATED, it observes the backup_auto_storage
-        // setting (storing backups @ real location. For recycle bin we want to ensure that
-        // backup files are always stored in Moodle file area. In order to achieve that, we
-        // hack the setting here via $CFG->forced_plugin_settings, so it won't interfere other
-        // operations.  See MDL-65218 for more information.
+        // settings (storing backups @ real location and potentially not including files).
+        // For recycle bin we want to ensure that backup files are always stored in Moodle file
+        // area and always contain the users' files. In order to achieve that, we hack the
+        // setting here via $CFG->forced_plugin_settings, so it won't interfere other operations.
+        // See MDL-65218 and MDL-35773 for more information.
         // This hack will be removed once recycle bin switches to use its own backup mode, with
-        // own preferences and 100% appart from MODLE_AUTOMATED.
+        // own preferences and 100% separate from MOODLE_AUTOMATED.
         // TODO: Remove this as part of MDL-65228.
-        $CFG->forced_plugin_settings['backup'] = ['backup_auto_storage' => 0];
+        $CFG->forced_plugin_settings['backup'] = ['backup_auto_storage' => 0, 'backup_auto_files' => 1];
 
         // Backup the course.
         $user = get_admin();
index deec65c..0353c2c 100644 (file)
@@ -113,14 +113,15 @@ class course_bin extends base_bin {
         }
 
         // As far as recycle bin is using MODE_AUTOMATED, it observes the backup_auto_storage
-        // setting (storing backups @ real location. For recycle bin we want to ensure that
-        // backup files are always stored in Moodle file area. In order to achieve that, we
-        // hack the setting here via $CFG->forced_plugin_settings, so it won't interfere other
-        // operations.  See MDL-65218 for more information.
+        // settings (storing backups @ real location and potentially not including files).
+        // For recycle bin we want to ensure that backup files are always stored in Moodle file
+        // area and always contain the users' files. In order to achieve that, we hack the
+        // setting here via $CFG->forced_plugin_settings, so it won't interfere other operations.
+        // See MDL-65218 and MDL-35773 for more information.
         // This hack will be removed once recycle bin switches to use its own backup mode, with
-        // own preferences and 100% appart from MODLE_AUTOMATED.
+        // own preferences and 100% separate from MOODLE_AUTOMATED.
         // TODO: Remove this as part of MDL-65228.
-        $CFG->forced_plugin_settings['backup'] = ['backup_auto_storage' => 0];
+        $CFG->forced_plugin_settings['backup'] = ['backup_auto_storage' => 0, 'backup_auto_files' => 1];
 
         // Backup the activity.
         $user = get_admin();