Skip to content
Browse files

MDL-28025 pagelib improve error message when $PAGE->context isn't set

  • Loading branch information...
1 parent 50d32a2 commit c78f8443e6535b29bd5a0fe401c4720103d1f143 Mark Johnson committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/pagelib.php
View
4 lib/pagelib.php
@@ -340,7 +340,9 @@ protected function magic_get_context() {
// cli scripts work in system context, do not annoy devs with debug info
// very few scripts do not use cookies, we can safely use system as default context there
} else {
- debugging('Coding problem: this page does not set $PAGE->context properly.');
+ debugging('Coding problem: $PAGE->context was not set. You may have forgotten '
+ .'to call require_login() or $PAGE->set_context(). The page may not display '
+ .'correctly as a result');
}
$this->_context = get_context_instance(CONTEXT_SYSTEM);
}

0 comments on commit c78f844

Please sign in to comment.
Something went wrong with that request. Please try again.