mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Fix in forum_make_mail_post()
This commit is contained in:
parent
4be6bced7f
commit
2a692058d0
1 changed files with 5 additions and 7 deletions
|
@ -274,8 +274,6 @@ function forum_cron() {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (! $discussion = get_record("forum_discussions", "id", "$post->discussion")) {
|
if (! $discussion = get_record("forum_discussions", "id", "$post->discussion")) {
|
||||||
mtrace("Could not find discussion $post->discussion");
|
mtrace("Could not find discussion $post->discussion");
|
||||||
continue;
|
continue;
|
||||||
|
@ -341,7 +339,7 @@ function forum_cron() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// make sure we're allowed to see it...
|
// make sure we're allowed to see it...
|
||||||
if (!forum_user_can_see_post($forum,$discussion,$post,$userto)) {
|
if (!forum_user_can_see_post($forum, $discussion, $post, $userto)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1712,11 +1710,11 @@ function forum_make_mail_post(&$post, $user, $touser, $course,
|
||||||
static $formattedtextid; // The ID number of the post
|
static $formattedtextid; // The ID number of the post
|
||||||
|
|
||||||
|
|
||||||
if (!$forumid = get_record('discussion', 'id', $post->discussion)) {
|
if (!$forum = get_record('forum', 'id', $post->discussion)) {
|
||||||
error('Could not get the forum id for the discussion the post belongs to');
|
mtrace('Could not get the forum for the discussion the post belongs to');
|
||||||
}
|
}
|
||||||
if (!$cm = get_coursemodule_from_instance('forum', $forumid)) {
|
if (!$cm = get_coursemodule_from_instance('forum', $forum->id)) {
|
||||||
error('Course Module ID was incorrect');
|
mtrace('Course Module ID was incorrect');
|
||||||
}
|
}
|
||||||
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
|
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue