Skip to content

Commit

Permalink
Merge branch 'wip-mdl-33159-m21' of git://github.com/rajeshtaneja/moo…
Browse files Browse the repository at this point in the history
…dle into MOODLE_21_STABLE
  • Loading branch information
Aparup Banerjee committed Jul 24, 2012
2 parents f3ab1e0 + 6819bed commit b693256
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions course/edit.php
Expand Up @@ -85,6 +85,13 @@
//editor should respect category context if course context is not set.
$editoroptions['context'] = $catcontext;
$course = file_prepare_standard_editor($course, 'summary', $editoroptions, null, 'course', 'summary', null);

// Set up the default restricted module list
if (!empty($CFG->restrictbydefault)) {
if (!empty($CFG->defaultallowedmodules)) {
$course->allowedmods = explode(',', $CFG->defaultallowedmodules);
}
}
}

// first create the form
Expand Down
2 changes: 1 addition & 1 deletion course/lib.php
Expand Up @@ -3778,7 +3778,7 @@ function create_course($data, $editoroptions = NULL) {
fix_course_sortorder();

// update module restrictions
if ($course->restrictmodules) {
if ($course->restrictmodules || $CFG->restrictbydefault ) {
if (isset($data->allowedmods)) {
update_restricted_mods($course, $data->allowedmods);
} else {
Expand Down

0 comments on commit b693256

Please sign in to comment.