Merge branch 'MDL-62666-36' of git://github.com/junpataleta/moodle into MOODLE_36_STABLE
This commit is contained in:
@@ -3420,6 +3420,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();
|
||||
|
||||
Reference in New Issue
Block a user