Skip to content

Commit

Permalink
MDL-82959 tool_recyclebin: Avoid null value for forcedsettings
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-csg committed Sep 6, 2024
1 parent 6a7b69a commit 851c6d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions admin/tool/recyclebin/classes/category_bin.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public function store_item($course) {
// This hack will be removed once recycle bin switches to use its own backup mode, with
// own preferences and 100% separate from MOODLE_AUTOMATED.
// TODO: Remove this as part of MDL-65228.
$forcedbackupsettings = $CFG->forced_plugin_settings['backup'] ?? null;
$forcedbackupsettings = $CFG->forced_plugin_settings['backup'] ?? [];
$CFG->forced_plugin_settings['backup']['backup_auto_storage'] = 0;
$CFG->forced_plugin_settings['backup']['backup_auto_files'] = 1;

Expand Down Expand Up @@ -253,7 +253,7 @@ public function restore_item($item) {
// This hack will be removed once recycle bin switches to use its own backup mode, with
// own preferences and 100% separate from MOODLE_AUTOMATED.
// TODO: Remove this as part of MDL-65228.
$forcedrestoresettings = $CFG->forced_plugin_settings['restore'] ?? null;
$forcedrestoresettings = $CFG->forced_plugin_settings['restore'] ?? [];
$CFG->forced_plugin_settings['restore']['restore_general_users'] = 1;
$CFG->forced_plugin_settings['restore']['restore_general_groups'] = 1;

Expand Down
2 changes: 1 addition & 1 deletion admin/tool/recyclebin/classes/course_bin.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function store_item($cm) {
// This hack will be removed once recycle bin switches to use its own backup mode, with
// own preferences and 100% separate from MOODLE_AUTOMATED.
// TODO: Remove this as part of MDL-65228.
$forcedbackupsettings = $CFG->forced_plugin_settings['backup'] ?? null;
$forcedbackupsettings = $CFG->forced_plugin_settings['backup'] ?? [];
$CFG->forced_plugin_settings['backup']['backup_auto_storage'] = 0;
$CFG->forced_plugin_settings['backup']['backup_auto_files'] = 1;

Expand Down

0 comments on commit 851c6d0

Please sign in to comment.