Affects Version/s: 3.5.5, 3.6.3
Steps to reproduce:
- Login as admin
- Go to /admin/settings.php?section=automated
- Enable and configure automated backup as usual
- Set backup | backup_auto_storage = specified directory for automated backups
- Set backup | backup_auto_destination to a directory where the webserver is allowed to write to, for example /var/www/foo
- Login as teacher
- Go to a course
- Create an arbitrary activity
- Delete this activity
- Go to the course's recycle bin
- Wait some time for the adhoc background task which should move the activity to recycle bin to finish
- The deleted activity is visible in the recycle bin
- The deleted activity is not visible in the recycle bin
- Instead, there is a new file called similar to backup-moodle2-activity-9022-20190329-1302.mbz in /var/www/foo.
This is a regression of
MDL-63263. With the change in https://github.com/moodle/moodle/commit/5810888077b66a21f48bb5ce3f5eeef71016ec5b#diff-4c349047314dcebe0c39920f3a8ce822R122, not only the backup settings are taken from the automated backup configuration, but also the backup destination.
As backup | backup_auto_storage is set to the specified directory for automated backups, the backuped activity can't be moved from the automated backups file area to the recycle bin filearea anymore.
As already pointed out by Eloy Lafuente (stronk7) in https://tracker.moodle.org/browse/MDL-63263?focusedCommentId=662570&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-662570, the re-use of backup mode MODE_AUTOMATED should most probably be replaced by a new MODE_RECYCLEBIN. I would not want to still re-use MODE_AUTOMATED and to have to recurve the backup destination in case we are backuping from recycling bin.
You can circumvent the regression either by setting backup | backup_auto_storage = Course backup file area temporarily (which has its own implications as you most probably didn't want this when you decided for specified directory for automated backups) or you can roll back the important parts of