MDL-36091 added debugging() calls in blocks of code marked as "should never happen"

This commit is contained in:
Andrew Davis
2013-02-11 13:24:52 +08:00
committed by Dan Poltawski
parent 06d8f380e9
commit c90e6b4644
5 changed files with 9 additions and 1 deletions
+2
View File
@@ -393,6 +393,7 @@ function has_capability($capability, context $context, $user = null, $doanything
if (!isset($USER->id)) {
// should never happen
$USER->id = 0;
debugging('Capability check being performed on a user with no ID.', DEBUG_DEVELOPER);
}
// make sure there is a real user specified
@@ -2062,6 +2063,7 @@ function can_access_course(stdClass $course, $user = null, $withcapability = '',
if (!isset($USER->id)) {
// should never happen
$USER->id = 0;
debugging('Course access check being performed on a user with no ID.', DEBUG_DEVELOPER);
}
// make sure there is a user specified