Skip to content
Permalink
Browse files
Merge branch 'MDL-62666-35' of git://github.com/junpataleta/moodle in…
…to MOODLE_35_STABLE
  • Loading branch information
David Monllaó committed Feb 11, 2019
2 parents 3ae9b14 + 6a09040 commit 603aaf66c4d759303ea14480293cddaed6ddb3b3
Showing with 7 additions and 0 deletions.
  1. +7 −0 course/lib.php
@@ -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();

0 comments on commit 603aaf6

Please sign in to comment.