MDL-54892 core: Pass proper parameter for plugin uninstall queries
authorTobias Reischmann <tobias.reischmann@wi.uni-muenster.de>
Fri, 10 Jun 2016 12:43:26 +0000 (14:43 +0200)
committerTobias Reischmann <tobias.reischmann@wi.uni-muenster.de>
Tue, 21 Jun 2016 07:20:54 +0000 (09:20 +0200)
lib/adminlib.php

index c8f24f6..113071b 100644 (file)
@@ -199,14 +199,14 @@ function uninstall_plugin($type, $name) {
     $DB->delete_records('event', array('modulename' => $pluginname));
 
     // Delete scheduled tasks.
     $DB->delete_records('event', array('modulename' => $pluginname));
 
     // Delete scheduled tasks.
-    $DB->delete_records('task_scheduled', array('component' => $pluginname));
+    $DB->delete_records('task_scheduled', array('component' => $component));
 
     // Delete Inbound Message datakeys.
     $DB->delete_records_select('messageinbound_datakeys',
 
     // Delete Inbound Message datakeys.
     $DB->delete_records_select('messageinbound_datakeys',
-            'handler IN (SELECT id FROM {messageinbound_handlers} WHERE component = ?)', array($pluginname));
+            'handler IN (SELECT id FROM {messageinbound_handlers} WHERE component = ?)', array($component));
 
     // Delete Inbound Message handlers.
 
     // Delete Inbound Message handlers.
-    $DB->delete_records('messageinbound_handlers', array('component' => $pluginname));
+    $DB->delete_records('messageinbound_handlers', array('component' => $component));
 
     // delete all the logs
     $DB->delete_records('log', array('module' => $pluginname));
 
     // delete all the logs
     $DB->delete_records('log', array('module' => $pluginname));