Moodle 3.9 Recycle Bin usage (or bug?)

Moodle 3.9 Recycle Bin usage (or bug?)

by Luis Guerra -
Number of replies: 5

Our Moodle 3.9 Recycle Bin is not working as intended, or we're missing something here...

After we delete an Activity or Resource (say, for instance, an uploaded file) to a Topic and then delete it, all seems to work properly and it appears in the recycle bin. But, when we restore it from the recycle bin, it just 'disappears'. No matter the type of activity/resource we try, they all just disappear. They are no longer in the Recycle Bin, nor are they back on the original place where they where deleted from.

From what we've seen online, the resource should return to the original place it was deleted from, right? Is there any other place to look for them?

Tanks in advance,
Luis Guerra

Average of ratings: -
In reply to Luis Guerra

Re: Moodle 3.9 Recycle Bin usage (or bug?)

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

It sounds like you're looking in the right place. I tried this on my site, Moodle 3.9.4+ (Build: 20210204):

  1. I delete the activity, Test File 1:
    Screenshot showing the activity Edit drop-down menu with Delete selected
  2. I go to the course's Recycle Bin:
    Screenshot: Course action drop-down menu with "Recycle bin selected".
  3. In the Recycle Bin the deleted activity appears:
    Screenshot: course recycle bin with deleted activity listed.
  4. I click ⮉ Restore and see the message to say it has been restored:
    Screenshot: Course recycle bin with activity restored.
  5. I go back to the course and, as expected, the activity is back:
    Screenshot: Course page showing restored activity.

The only thing I can suggest checking is that the cron is running and that it's completing successfully. But I think this would only affect the deleted item being moved to the Recycle Bin, not the restore.

In reply to Leon Stringer

Re: Moodle 3.9 Recycle Bin usage (or bug?)

by Luis Guerra -
Ok, I found out what it was...
It is not clear how Recycle Bin works and I'm guessing others may not know this as well, but the Recycle Bin only works with the settings that are in effect for the Automatic Backups (Administration > Site administration > Courses > Backups > Automated backup setup).
Thus, the items that aren't selected on those settings wont be recovered from the Recycle Bin, although there is no error or indication of this (unless you put the error log level in Debugging, which was how I found out).
Average of ratings:Useful (5)
In reply to Luis Guerra

Re: Moodle 3.9 Recycle Bin usage (or bug?)

by Leon Stringer -
Picture of Core developers Picture of Particularly helpful Moodlers

Nice catch, I didn't know about that problem. It looks like there's an open Tracker issue for this: MDL-66221.

Average of ratings:Useful (1)
In reply to Leon Stringer

Re: Moodle 3.9 Recycle Bin usage (or bug?)

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Thanks Luis for the info and thanks Leon for the tracker issue. I have added a note to the documentation Recycle bin about the setting backup_auto_activities needing to be enabled.

Average of ratings:Useful (2)
In reply to Helen Foster

Re: Moodle 3.9 Recycle Bin usage (or bug?)

by Przemek Kaszubski -
Picture of Particularly helpful Moodlers Picture of Testers
For Activities to properly restore from the Recycle bin, along with any user data included (submitted assignments, grades, forum posts etc.), these two must ALSO be set (ticked):

Automated backup setup > Automated backup settings :
backup | backup_auto_users

General restore defaults > General restore settings:
restore | restore_general_users

(cf. https://moodle.org/mod/forum/discuss.php?d=430543#p1732611 )

I think this too should be added in the docs etc. - so I have now expanded the note on https://docs.moodle.org/311/en/Recycle_bin#Enabling_the_recycle_bin .
Average of ratings:Useful (3)