Skip to content

Commit

Permalink
Merge branch 'wip-MDL-59523-master-fix' of git://github.com/abgreeve/…
Browse files Browse the repository at this point in the history
…moodle
  • Loading branch information
andrewnicols committed Aug 2, 2017
2 parents 2a2f7b6 + 39b8357 commit 2b2ae40
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions mod/scorm/lib.php
Expand Up @@ -834,6 +834,7 @@ function scorm_reset_userdata($data) {
// Any changes to the list of dates that needs to be rolled should be same during course restore and course reset.
// See MDL-9367.
shift_course_mod_dates('scorm', array('timeopen', 'timeclose'), $data->timeshift, $data->courseid);
$status[] = array('component' => $componentstr, 'item' => get_string('datechanged'), 'error' => false);

return $status;
}
Expand Down
1 change: 1 addition & 0 deletions mod/wiki/lib.php
Expand Up @@ -234,6 +234,7 @@ function wiki_reset_userdata($data) {
// Any changes to the list of dates that needs to be rolled should be same during course restore and course reset.
// See MDL-9367.
shift_course_mod_dates('wiki', array('editbegin', 'editend'), $data->timeshift, $data->courseid);
$status[] = array('component' => $componentstr, 'item' => get_string('datechanged'), 'error' => false);

return $status;
}
Expand Down
8 changes: 5 additions & 3 deletions mod/workshop/lib.php
Expand Up @@ -1894,25 +1894,27 @@ function workshop_reset_userdata(stdClass $data) {
// See MDL-9367.
shift_course_mod_dates('workshop', array('submissionstart', 'submissionend', 'assessmentstart', 'assessmentend'),
$data->timeshift, $data->courseid);
$status = array();
$status[] = array('component' => get_string('modulenameplural', 'workshop'), 'item' => get_string('datechanged'),
'error' => false);

if (empty($data->reset_workshop_submissions)
and empty($data->reset_workshop_assessments)
and empty($data->reset_workshop_phase) ) {
// Nothing to do here.
return array();
return $status;
}

$workshoprecords = $DB->get_records('workshop', array('course' => $data->courseid));

if (empty($workshoprecords)) {
// What a boring course - no workshops here!
return array();
return $status;
}

require_once($CFG->dirroot . '/mod/workshop/locallib.php');

$course = $DB->get_record('course', array('id' => $data->courseid), '*', MUST_EXIST);
$status = array();

foreach ($workshoprecords as $workshoprecord) {
$cm = get_coursemodule_from_instance('workshop', $workshoprecord->id, $course->id, false, MUST_EXIST);
Expand Down

0 comments on commit 2b2ae40

Please sign in to comment.