Permalink
Browse files

Merge branch 'MDL-32630-workshop-calendar_22' of git://github.com/mud…

…rd8mz/moodle into MOODLE_22_STABLE
  • Loading branch information...
2 parents cf1f0df + 08258a6 commit b8fffc6128060f93720cf1ec273bfaa4e8c38da4 @stronk7 stronk7 committed Apr 26, 2012
Showing with 12 additions and 8 deletions.
  1. +12 −8 mod/workshop/lib.php
View
@@ -1441,8 +1441,9 @@ function workshop_calendar_update(stdClass $workshop, $cmid) {
// should not be set but just in case
unset($event->id);
}
- // calendar_event::create will reuse a db record if the id field is set
- calendar_event::create($event);
+ // update() will reuse a db record if the id field is set
+ $eventobj = new calendar_event($event);
+ $eventobj->update($event, false);
}
if ($workshop->submissionend) {
@@ -1455,8 +1456,9 @@ function workshop_calendar_update(stdClass $workshop, $cmid) {
// should not be set but just in case
unset($event->id);
}
- // calendar_event::create will reuse a db record if the id field is set
- calendar_event::create($event);
+ // update() will reuse a db record if the id field is set
+ $eventobj = new calendar_event($event);
+ $eventobj->update($event, false);
}
if ($workshop->assessmentstart) {
@@ -1469,8 +1471,9 @@ function workshop_calendar_update(stdClass $workshop, $cmid) {
// should not be set but just in case
unset($event->id);
}
- // calendar_event::create will reuse a db record if the id field is set
- calendar_event::create($event);
+ // update() will reuse a db record if the id field is set
+ $eventobj = new calendar_event($event);
+ $eventobj->update($event, false);
}
if ($workshop->assessmentend) {
@@ -1483,8 +1486,9 @@ function workshop_calendar_update(stdClass $workshop, $cmid) {
// should not be set but just in case
unset($event->id);
}
- // calendar_event::create will reuse a db record if the id field is set
- calendar_event::create($event);
+ // update() will reuse a db record if the id field is set
+ $eventobj = new calendar_event($event);
+ $eventobj->update($event, false);
}
// delete any leftover events

0 comments on commit b8fffc6

Please sign in to comment.