Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'MDL-26513_restrict_modules' of git://github.com/stronk7…

…/moodle
  • Loading branch information...
commit 5df4d6ccab0fe0ba327c1dd510f379ced1507752 2 parents 9da0fc1 + e4f72d1
@stronk7 stronk7 authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 backup/moodle2/restore_stepslib.php
View
5 backup/moodle2/restore_stepslib.php
@@ -1021,8 +1021,6 @@ public function process_course($data) {
global $CFG, $DB;
$data = (object)$data;
- $coursetags = isset($data->tags['tag']) ? $data->tags['tag'] : array();
- $coursemodules = isset($data->allowed_modules['module']) ? $data->allowed_modules['module'] : array();
$oldid = $data->id; // We'll need this later
$fullname = $this->get_setting_value('course_fullname');
@@ -1038,6 +1036,9 @@ public function process_course($data) {
$data->shortname= $shortname;
$data->idnumber = '';
+ // Only restrict modules if original course was and target site too for new courses
+ $data->restrictmodules = $data->restrictmodules && !empty($CFG->restrictmodulesfor) && $CFG->restrictmodulesfor == 'all';
+
$data->startdate= $this->apply_date_offset($data->startdate);
if ($data->defaultgroupingid) {
$data->defaultgroupingid = $this->get_mappingid('grouping', $data->defaultgroupingid);
Please sign in to comment.
Something went wrong with that request. Please try again.