Merge branch 'MDL-46534-27' of git://github.com/andrewnicols/moodle into MOODLE_27_STABLE

This commit is contained in:
Sam Hemelryk
2014-11-25 15:47:57 +13:00
+2 -5
View File
@@ -3472,16 +3472,13 @@ function mod_duplicate_activity($course, $cm, $sr = null) {
$rc->execute_plan();
// now a bit hacky part follows - we try to get the cmid of the newly
// restored copy of the module
// Now a bit hacky part follows - we try to get the cmid of the newly
// restored copy of the module.
$newcmid = null;
$tasks = $rc->get_plan()->get_tasks();
foreach ($tasks as $task) {
error_log("Looking at a task");
if (is_subclass_of($task, 'restore_activity_task')) {
error_log("Looking at a restore_activity_task task");
if ($task->get_old_contextid() == $cmcontext->id) {
error_log("Contexts match");
$newcmid = $task->get_moduleid();
break;
}