From 596cbeb955abd987b05baaf070dbf3c7d3371dcf Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Mon, 20 Jan 2020 17:15:55 +0100 Subject: [PATCH] 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. --- course/lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/course/lib.php b/course/lib.php index 23088e544dd..bbe47af569a 100644 --- a/course/lib.php +++ b/course/lib.php @@ -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)) {