Permalink
Browse files

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

…rd8mz/moodle into MOODLE_21_STABLE
  • Loading branch information...
2 parents 7a48124 + 8683c24 commit 538d482927f619d561dd0f43a52e91d7763ef01d @stronk7 stronk7 committed Apr 26, 2012
Showing with 12 additions and 8 deletions.
  1. +12 −8 mod/workshop/lib.php
View
@@ -1440,8 +1440,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) {
@@ -1454,8 +1455,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) {
@@ -1468,8 +1470,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) {
@@ -1482,8 +1485,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 538d482

Please sign in to comment.