Skip to content

Commit

Permalink
MDL-22078 course reset: No enddate time shift if no enddate
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Oct 6, 2016
1 parent 21d8921 commit 40eea06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions course/reset_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ public function validation($data, $files) {
if ($data['reset_end_date'] != 0) {
// End date set by the user has preference.
$coursedata['enddate'] = $data['reset_end_date'];
} else if ($data['reset_start_date'] > 0) {
// Otherwise reset_course_userdata will add the start date time shift.
} else if ($data['reset_start_date'] > 0 && $course->enddate != 0) {
// Otherwise, if the current course enddate is set, reset_course_userdata will add the start date time shift to it.
$timeshift = $data['reset_start_date'] - usergetmidnight($course->startdate);
$coursedata['enddate'] = $course->enddate + $timeshift;
} else {
Expand Down

0 comments on commit 40eea06

Please sign in to comment.