Browse Source

Fix #221 always pass timestart to calendar update function.

MOODLE_31_STABLE
Dan Marsden 8 years ago
parent
commit
90e336920c
  1. 2
      classes/calendar_helpers.php
  2. 2
      classes/structure.php

2
classes/calendar_helpers.php

@ -84,7 +84,7 @@ function create_calendar_events($sessionsids) {
* @param $timestart int start time of the event * @param $timestart int start time of the event
* @return bool result of updating * @return bool result of updating
*/ */
function update_calendar_event($caleventid, $timeduration, $timestart = null) { function update_calendar_event($caleventid, $timeduration, $timestart) {
$caleventdata = new stdClass(); $caleventdata = new stdClass();
$caleventdata->timeduration = $timeduration; $caleventdata->timeduration = $timeduration;
$caleventdata->timestart = $timestart; $caleventdata->timestart = $timestart;

2
classes/structure.php

@ -916,7 +916,7 @@ class mod_attendance_structure {
$sess->timemodified = $now; $sess->timemodified = $now;
$DB->update_record('attendance_sessions', $sess); $DB->update_record('attendance_sessions', $sess);
if ($sess->caleventid) { if ($sess->caleventid) {
update_calendar_event($sess->caleventid, $duration); update_calendar_event($sess->caleventid, $duration, $sess->sessdate);
} }
$event = \mod_attendance\event\session_duration_updated::create(array( $event = \mod_attendance\event\session_duration_updated::create(array(
'objectid' => $this->id, 'objectid' => $this->id,

Loading…
Cancel
Save