Merge branch 'MDL-53297-master' of git://github.com/cescobedo/moodle

This commit is contained in:
Eloy Lafuente (stronk7)
2018-08-07 15:57:00 +02:00
4 changed files with 9 additions and 23 deletions
+2
View File
@@ -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
-23
View File
@@ -5009,7 +5009,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) {
@@ -5035,12 +5034,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');
}
@@ -5080,22 +5073,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) {
+2
View File
@@ -10,6 +10,8 @@ information provided here is intended especially for developers.
are called, the userid of the requesting user is also passed to them.
* The following functions have been finally deprecated and can not be used anymore:
- update_module_button()
* 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 ===
+5
View File
@@ -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