Merged fix from 1.6 for bug:

Notice: Undefined property: id in /home/moodle/public_html/certificate/mod/forum/discuss.php on line 38

This happens when the user is not logged in and wants to view a forum of type
news.
This commit is contained in:
vyshane 2006-06-14 08:47:19 +00:00
parent 05b7eba955
commit 883f4e3dc6

View File

@ -35,7 +35,7 @@
} elseif ($forum->type == "news") {
if (!((isadmin() and !empty($CFG->admineditalways))
|| isteacher($course->id)
|| $USER->id == $discussion->userid
|| (!empty($USER->id) && $USER->id == $discussion->userid)
|| (($discussion->timestart == 0 || $discussion->timestart <= time())
&& ($discussion->timeend == 0 || $discussion->timeend > time())))) {
error('Discussion ID was incorrect or no longer exists', "$CFG->wwwroot/mod/forum/view.php?f=$forum->id");