From aa4be7608255dbf3081eb87c819d8979544fea18 Mon Sep 17 00:00:00 2001 From: mchurch Date: Thu, 23 Aug 2007 13:38:21 +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 5d2c7fa2083..57f96046002 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -1726,11 +1726,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)) {