Skip to content

Commit

Permalink
forum MDL-19808 Fixed minor regressions caused by upgrades
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Dec 7, 2009
1 parent 976c007 commit 8a87691
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
27 changes: 18 additions & 9 deletions mod/forum/discuss.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,23 @@
$mark = optional_param('mark', '', PARAM_ALPHA); // Used for tracking read posts if user initiated.
$postid = optional_param('postid', 0, PARAM_INT); // Used for tracking read posts if user initiated.

$PAGE->set_url('/mod/forum/post.php', array(
'd' => $d,
'parent' => $parent,
'mode' => $mode,
'mark' => $mark,
'postid' => $postid
));
$url = new moodle_url($CFG->wwwroot.'/mod/forum/discuss.php', array('d'=>$d));
if ($parent !== 0) {
$url->param('parent', $parent);
}
if ($mode !== 0) {
$url->param('mode', $mode);
}
if ($move !== 0) {
$url->param('move', $move);
}
if ($mark !== '') {
$url->param('mark', $mark);
}
if ($postid !== 0) {
$url->param('postid', $postid);
}
$PAGE->set_url($url);

if (!$discussion = $DB->get_record('forum_discussions', array('id' => $d))) {
print_error('invaliddiscussionid', 'forum');
Expand All @@ -35,7 +45,6 @@
if (!$cm = get_coursemodule_from_instance('forum', $forum->id, $course->id)) {
print_error('invalidcoursemodule');
}

require_course_login($course, true, $cm);

/// Add ajax-related libs
Expand Down Expand Up @@ -149,7 +158,7 @@

$searchform = forum_search_form($course);

$PAGE->navbar->add(format_string($discussion->name), new moodle_url($CFG->wwwroot.'/mod/forum/discuss.php', array('id'=>$discussion->id)));
$PAGE->navbar->add(format_string($discussion->name), new moodle_url($CFG->wwwroot.'/mod/forum/discuss.php', array('d'=>$discussion->id)));
if ($parent != $discussion->firstpost) {
$PAGE->navbar->add(format_string($post->subject));
}
Expand Down
4 changes: 3 additions & 1 deletion mod/forum/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -8395,7 +8395,9 @@ function forum_extend_settings_navigation($settingsnav, $module=null) {
$forum->forceopen = true;

$forumobject = $DB->get_record("forum", array("id" => $PAGE->cm->instance));

if (empty($PAGE->cm->context)) {
$PAGE->cm->context = get_context_instance(CONTEXT_MODULE, $PAGE->cm->instance);
}
if (!empty($USER->id) && !has_capability('moodle/legacy:guest', $PAGE->cm->context, NULL, false)) {
$notekey = false;
$helpbutton = false;
Expand Down

0 comments on commit 8a87691

Please sign in to comment.