Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'wip-MDL-19147-MOODLE_19_STABLE' of git://github.com/abg…

…reeve/moodle into MOODLE_19_STABLE
  • Loading branch information...
commit e114543f690b2e578a9c3205f88443d95d4da345 2 parents 7fe52ca + 24b048c
@samhemelryk samhemelryk authored
Showing with 9 additions and 1 deletion.
  1. +9 −1 mod/forum/discuss.php
View
10 mod/forum/discuss.php
@@ -61,6 +61,10 @@
if (!$forumto = get_record('forum', 'id', $move)) {
error('You can\'t move to that forum - it doesn\'t exist!', $return);
}
+
+ if ($forumto->type == 'single') {
+ error('Cannot move discussion to a simple single discussion forum.', $return);
+ }
if (!$cmto = get_coursemodule_from_instance('forum', $forumto->id, $course->id)) {
error('Target forum not found in this course.', $return);
@@ -187,6 +191,8 @@
}
$section = -1;
$forummenu = array();
+ // Check forum types and eliminate simple discussions.
+ $forumcheck = get_records('forum', 'course', $course->id, '', 'id, type');
foreach ($modinfo->instances['forum'] as $forumcm) {
if (!$forumcm->uservisible || !has_capability('mod/forum:startdiscussion',
get_context_instance(CONTEXT_MODULE,$forumcm->id))) {
@@ -197,7 +203,9 @@
$forummenu[] = "-------------- $strsection $forumcm->sectionnum --------------";
}
$section = $forumcm->sectionnum;
- if ($forumcm->instance != $forum->id) {
+ $forumidcompare = $forumcm->instance != $forum->id;
+ $forumtypecheck = $forumcheck[$forumcm->instance]->type !== 'single';
+ if ($forumidcompare and $forumtypecheck) {
$url = "discuss.php?d=$discussion->id&move=$forumcm->instance&sesskey=".sesskey();
$forummenu[$url] = format_string($forumcm->name);
}
Please sign in to comment.
Something went wrong with that request. Please try again.