-
Improvement
-
Resolution: Fixed
-
Minor
-
3.7.6, 3.8.3
-
MOODLE_37_STABLE, MOODLE_38_STABLE
-
MOODLE_39_STABLE
-
At the moment, when you delete a course, activity, or course category, you get a bunch of output saying "This category has been deleted because, after deleting the course, its questions weren't used any more." This is not a very helpful message. If a think was deleted, of course all the associated data deleted with it will be deleted too.
In fact, the more interesting case is that sometimes, things won't be deleted becuase something else was using them (due to MDL-14802). However, there is no output to tell you this.
Practically, this causes problems for third-party plugins. For example, at the moment, installing StudentQuiz causes some core unit tests to fail: https://github.com/frankkoch/moodle-mod_studentquiz/issues/227
And, generally it goes against basic principles of Moodle design for a back-end function like question_delete_activity to do output. This has caused problems in the past: MDL-64531. It also requires a number of unit tests to contain $this->expectOutputRegex('/'.get_string('unusedcategorydeleted', 'question').'/'); when than is pretty irrelevant to what is being tested.