-
Bug
-
Resolution: Fixed
-
Minor
-
4.1.9, 4.2.6, 4.3.3, 4.4
I've found that when attempting to store items in the recycle bin, certain forced config settings are being ignored and fall back to using the value stored in the database.
This is causing an issue because MDL-66221 introduced a check on backup_auto_activities, and if that it not set activities will not be stored in the recycle bin when they are deleted. We've ran into a weird situation where the DB entry for backup_auto_activities ('0') didn't match doesn't match the forced config ('1'), and the DB value was being used which meant nothing was being stored in the recycle bin.
After looking at the code it seems store_item and restore_item attempt to force two specific config values, but in doing so are overriding unrelated backup and restore forced config settings as well.
Reproduction steps:
- Go to Site administration > Courses > Backups > Automated backup setup.
- Disable "Include activities and resources" (backup | backup_auto_activities)
- In config.php, add this line to force the backup_auto_activities setting to 1:
$CFG->forced_plugin_settings['backup']['backup_auto_activities'] = '1'; - Reload the automated backup setup page to confirm that backup_auto_activities is Defined in config.php
- Create a new test course
- Create a new test activity - using label for complicity
- Delete the test activity
- Wait for recycle bin to be updated via ad-hoc task (~1 min), or run the task or cronjob manually.
- Go to the test course again and refresh the page.
- The activity won't be in the recycle bin, and the recycle bin won't even appear if autohide is on. There aren't any error messages.
- caused a regression
-
MDL-82959 Adhoc tasks for backup/restore fail if tool_recyclebin task runs at the same time
-
- Closed
-