MDL-35982 blog: prevent index throwing errors with 0 courseid

Regression from MDL-49845 where Dave made the page not handle courseid = 0
and so now some urls will send you back to a db error..
This commit is contained in:
Dan Poltawski
2015-11-26 14:10:25 +00:00
parent c18acb8997
commit afb7ec92ff
+2 -2
View File
@@ -63,9 +63,9 @@ if ($entryid and !isset($userid)) {
$userid = $entry->userid;
}
if (isset($userid) && !isset($courseid)) {
if (isset($userid) && empty($courseid)) {
$context = context_user::instance($userid);
} else if (isset($courseid) && $courseid != SITEID) {
} else if (!empty($courseid) && $courseid != SITEID) {
$context = context_course::instance($courseid);
} else {
$context = context_system::instance();