From 00472a2235fe7b2ea2cc625fc3e4fcd15038df85 Mon Sep 17 00:00:00 2001 From: mchurch Date: Thu, 23 Aug 2007 14:25:42 +0000 Subject: [PATCH] Moving get $cm outside of the 'forum_enabletimedposts' condition as it is needed even if this isn't set. --- mod/forum/lib.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 69365e0d0b..8da6ce8025 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -1765,11 +1765,12 @@ function forum_get_discussions($forum="0", $forumsort="d.timemodified DESC", $timelimit = ''; + if (!$cm = get_coursemodule_from_instance('forum', $forum)) { + error('Course Module ID was incorrect'); + } + if (!empty($CFG->forum_enabletimedposts)) { - if (!$cm = get_coursemodule_from_instance('forum', $forum)) { - error('Course Module ID was incorrect'); - } $modcontext = get_context_instance(CONTEXT_MODULE, $cm->id); if (!has_capability('mod/forum:viewhiddentimedposts', $modcontext)) { -- 2.39.5