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:17 +01:00
committed by David Mudrák
parent 77be1e3fe3
commit 596cbeb955
+3 -1
View File
@@ -1151,7 +1151,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)) {