Moodle 3.9 Recycle Bin usage (or bug?)

Moodle 3.9 Recycle Bin usage (or bug?)

Luis Guerra -
回帖数: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

回复Luis Guerra

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

Leon Stringer -
Core developers的头像 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.

回复Leon Stringer

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

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).
回复Luis Guerra

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

Leon Stringer -
Core developers的头像 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.

回复Leon Stringer

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

Helen Foster -
Core developers的头像 Documentation writers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Plugin developers的头像 Testers的头像 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.

回复Helen Foster

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

Przemek Kaszubski -
Particularly helpful Moodlers的头像 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 .