mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
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:
parent
206e179df5
commit
f883c681ff
2 changed files with 27 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue