mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Moving get $cm outside of the 'forum_enabletimedposts' condition as it is needed even if this isn't set.
This commit is contained in:
parent
68da9722db
commit
00472a2235
1 changed files with 4 additions and 3 deletions
|
@ -1765,11 +1765,12 @@ function forum_get_discussions($forum="0", $forumsort="d.timemodified DESC",
|
||||||
|
|
||||||
$timelimit = '';
|
$timelimit = '';
|
||||||
|
|
||||||
|
if (!$cm = get_coursemodule_from_instance('forum', $forum)) {
|
||||||
|
error('Course Module ID was incorrect');
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($CFG->forum_enabletimedposts)) {
|
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);
|
$modcontext = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||||
|
|
||||||
if (!has_capability('mod/forum:viewhiddentimedposts', $modcontext)) {
|
if (!has_capability('mod/forum:viewhiddentimedposts', $modcontext)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue