General plugins (Local): Recycle bin

Maintained by Picture of Skylar KeltySkylar Kelty
This plugin adds a "recycle bin" for course modules to Moodle.

Recycle bin 1.2 (Build: 2015081201)

Release notes

Moodle Recycle Bin

This plugin adds a "recycle bin" for course modules to Moodle. It requires a core hack.


As there is no pre-cm-deleted event, you will need to add a line to '/course/lib.php' (function course_delete_module), right after the first "if()".

diff --git a/course/lib.php b/course/lib.php
index e49bdf1..5f8d6e6 100644
--- a/course/lib.php
+++ b/course/lib.php
@@ -1654,6 +1654,9 @@ function course_delete_module($cmid) {
         return true;

+    // Notify the recycle bin plugin.
+    \local_recyclebin\Observer::pre_cm_delete($cm);
     // Get the module context.
     $modcontext = context_module::instance($cm->id);


Image of Menu

Moodle 2.8, 2.9

Version information

Version build number
Version release name
1.2 (Build: 2015081201)
Can be updated to
1.4 (Build: 2015082600) (2015082600), 3.4 (Build: 2016040600)
Stable version
MD5 Sum
Supported software
Moodle 2.8, Moodle 2.9

Version control information

Version control system (VCS)
VCS repository URL
VCS branch

Default installation instructions for plugins of the type General plugins (Local)

  1. Make sure you have all the required versions.
  2. Download and unpack the module.
  3. Place the folder in the "local" subdirectory.
  4. Visit to finish the installation.