diff --git a/course/format/upgrade.txt b/course/format/upgrade.txt index 16a2c668039..68d71947875 100644 --- a/course/format/upgrade.txt +++ b/course/format/upgrade.txt @@ -8,6 +8,8 @@ Overview of this plugin type at http://docs.moodle.org/dev/Course_formats Note that validate_format_options() is now always called when somebody creates or edits course or section and also during restore and course upload. Default implementation validates against the definition of the form elements for format options. +* The final deprecation of xxx_delete_course callback means that this function will no longer be called. + Please use the observer for event \core\event\course_content_deleted instead. === 3.5 === * Course formats should overwrite get_config_for_external function to return the course format settings viewable by the diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 928ec9f63ce..9d404d7a82f 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -4996,7 +4996,6 @@ function remove_course_contents($courseid, $showfeedback = true, array $options include_once("$moddir/lib.php"); // Shows php warning only if plugin defective. $moddelete = $modname .'_delete_instance'; // Delete everything connected to an instance. - $moddeletecourse = $modname .'_delete_course'; // Delete other stray stuff (uncommon). if ($instances) { foreach ($instances as $cm) { @@ -5022,12 +5021,6 @@ function remove_course_contents($courseid, $showfeedback = true, array $options } } } - if (function_exists($moddeletecourse)) { - // Execute optional course cleanup callback. Deprecated since Moodle 3.2. TODO MDL-53297 remove in 3.6. - debugging("Callback delete_course is deprecated. Function $moddeletecourse should be converted " . - 'to observer of event \core\event\course_content_deleted', DEBUG_DEVELOPER); - $moddeletecourse($course, $showfeedback); - } if ($instances and $showfeedback) { echo $OUTPUT->notification($strdeleted.get_string('pluginname', $modname), 'notifysuccess'); } @@ -5067,22 +5060,6 @@ function remove_course_contents($courseid, $showfeedback = true, array $options echo $OUTPUT->notification($strdeleted.get_string('type_mod_plural', 'plugin'), 'notifysuccess'); } - // Cleanup the rest of plugins. Deprecated since Moodle 3.2. TODO MDL-53297 remove in 3.6. - $cleanuplugintypes = array('report', 'coursereport', 'format'); - $callbacks = get_plugins_with_function('delete_course', 'lib.php'); - foreach ($cleanuplugintypes as $type) { - if (!empty($callbacks[$type])) { - foreach ($callbacks[$type] as $pluginfunction) { - debugging("Callback delete_course is deprecated. Function $pluginfunction should be converted " . - 'to observer of event \core\event\course_content_deleted', DEBUG_DEVELOPER); - $pluginfunction($course->id, $showfeedback); - } - if ($showfeedback) { - echo $OUTPUT->notification($strdeleted.get_string('type_'.$type.'_plural', 'plugin'), 'notifysuccess'); - } - } - } - // Delete questions and question categories. question_delete_course($course, $showfeedback); if ($showfeedback) { diff --git a/mod/upgrade.txt b/mod/upgrade.txt index 268866271bd..46a9e24bb0a 100644 --- a/mod/upgrade.txt +++ b/mod/upgrade.txt @@ -6,6 +6,8 @@ information provided here is intended especially for developers. * The final deprecation of xxx_get_types() callback means that this function will no longer be called. Please use get_shortcuts() instead. * lti_get_shortcuts has been deprecated. Please use get_shortcuts() instead to add items to the activity chooser. +* The final deprecation of xxx_delete_course callback means that this function will no longer be called. + Please use the observer for event \core\event\course_content_deleted instead. === 3.5 === diff --git a/report/upgrade.txt b/report/upgrade.txt index f410e0b331a..96565744b37 100644 --- a/report/upgrade.txt +++ b/report/upgrade.txt @@ -1,6 +1,11 @@ This files describes API changes in /report/* - plugins, information provided here is intended especially for developers. +=== 3.6 === + +* The final deprecation of xxx_delete_course callback means that this function will no longer be called. + Please use the observer for event \core\event\course_content_deleted instead. + === 3.2 === * Callback delete_course is deprecated and should be replaced with observer for event \core\event\course_content_deleted * The report_log_print_graph signature and behaviour has changed to generate charts using