Skip to content

Commit

Permalink
MDL-28025 pagelib improve error message when $PAGE->context isn't set
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Johnson committed Jun 27, 2011
1 parent 50d32a2 commit c78f844
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/pagelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit c78f844

Please sign in to comment.