MDL-68645 output: Make module generators fail if they init the output

The coding exception hint should say it all. Creating an activity module
should not need any output function call. It turned out it can lead to
hard-to-debug bugs and unexpected behaviour. So better to explicitly
fail and let the developer fix the code.
This commit is contained in:
Tim Hunt 2020-05-09 09:49:38 +01:00 committed by David Mudrák
parent 206e179df5
commit f883c681ff
2 changed files with 27 additions and 1 deletions

View file

@ -1572,6 +1572,15 @@ class moodle_page {
$this->_wherethemewasinitialised = debug_backtrace();
}
/**
* For diagnostic/debugging purposes, find where the theme setup was triggered.
*
* @return null|array null if theme not yet setup. Stacktrace if it was.
*/
public function get_where_theme_was_initialised() {
return $this->_wherethemewasinitialised;
}
/**
* Reset the theme and output for a new context. This only makes sense from
* external::validate_context(). Do not cheat.