Skip to content

Commit

Permalink
Merge branch 'MDL-62666-35' of git://github.com/junpataleta/moodle in…
Browse files Browse the repository at this point in the history
…to MOODLE_35_STABLE
  • Loading branch information
David Monllaó committed Feb 11, 2019
2 parents 3ae9b14 + 6a09040 commit 603aaf6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions course/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3468,6 +3468,13 @@ function duplicate_module($course, $cm) {
$rc = new restore_controller($backupid, $course->id,
backup::INTERACTIVE_NO, backup::MODE_IMPORT, $USER->id, backup::TARGET_CURRENT_ADDING);

// Make sure that the restore_general_groups setting is always enabled when duplicating an activity.
$plan = $rc->get_plan();
$groupsetting = $plan->get_setting('groups');
if (empty($groupsetting->get_value())) {
$groupsetting->set_value(true);
}

$cmcontext = context_module::instance($cm->id);
if (!$rc->execute_precheck()) {
$precheckresults = $rc->get_precheck_results();
Expand Down

0 comments on commit 603aaf6

Please sign in to comment.