Skip to content

Commit

Permalink
MDL-26513 restore - observe target site restrictmodulesfor setting
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Feb 21, 2011
1 parent eabbb12 commit e4f72d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backup/moodle2/restore_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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);
Expand Down

0 comments on commit e4f72d1

Please sign in to comment.