From: tjhunt Date: Fri, 9 Jan 2009 05:34:49 +0000 (+0000) Subject: accesslib: MDL-17626 admin/modules.php should call delete_context when a module is... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=df2e8971ffa00dfd3fa2ca864d6f29ce2ac23b4b;p=moodle.git accesslib: MDL-17626 admin/modules.php should call delete_context when a module is uninstalled. --- diff --git a/admin/modules.php b/admin/modules.php index ffb22524b7..143a68a10e 100644 --- a/admin/modules.php +++ b/admin/modules.php @@ -120,6 +120,13 @@ if (!$DB->delete_records("course_modules", array("module"=>$module->id))) { notify("Error occurred while deleting all $strmodulename records in course_modules table"); } + if ($coursemods) { + foreach ($coursemods as $coursemod) { + if (!delete_context(CONTEXT_MODULE, $coursemod->id)) { + notify("Could not delete the context for $strmodulename with id = $coursemod->id"); + } + } + } // Then delete all the logs if (!$DB->delete_records("log", array("module"=>$module->name))) {