MDL-64531 course: course_delete_module shouldn't output during AJAX

Committer's note: This change was originally part of a bigger patchset
submitted by the author. This is a stripped-down version that does not
use phpunit tests for the new behaviour.
This commit is contained in:
Tim Hunt
2020-01-20 18:07:25 +01:00
committed by David Mudrák
parent b2c0237ae8
commit d00045e8f5
+3 -1
View File
@@ -1144,7 +1144,9 @@ function course_delete_module($cmid, $async = false) {
}
// Delete activity context questions and question categories.
question_delete_activity($cm);
$showinfo = !defined('AJAX_SCRIPT') || AJAX_SCRIPT == '0';
question_delete_activity($cm, $showinfo);
// Call the delete_instance function, if it returns false throw an exception.
if (!$deleteinstancefunction($cm->instance)) {