diff --git a/search/documents/forum_document.php b/search/documents/forum_document.php index 16d5845a592d3..b72b2c450293f 100644 --- a/search/documents/forum_document.php +++ b/search/documents/forum_document.php @@ -250,9 +250,9 @@ function forum_check_text_access($path, $itemtype, $this_id, $user, $group_id){ // get the glossary object and all related stuff $post = get_record('forum_posts', 'id', $this_id); - $dicussion = get_record('forum_discussion', 'id', $post->discussion); + $discussion = get_record('forum_discussions', 'id', $post->discussion); $course = get_record('course', 'id', $discussion->course); - $cm = get_coursemodule_from_instance('forum', $dicussion->forum, $course->id); + $cm = get_coursemodule_from_instance('forum', $discussion->forum, $course->id); $context_module = get_context_instance(CONTEXT_MODULE, $cm->id); if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', $context_module)) return false; @@ -266,4 +266,4 @@ function forum_check_text_access($path, $itemtype, $this_id, $user, $group_id){ return true; } //forum_check_text_access -?> \ No newline at end of file +?>