Skip to content

Commit

Permalink
MDL-55715 calendar: Only update events from the current subscription
Browse files Browse the repository at this point in the history
The iCal import should only update calendar events from the current
subscription not any subscription that contains the same event.
  • Loading branch information
sbourget committed Dec 14, 2016
1 parent 5ef81f2 commit 4558358
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion calendar/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3034,7 +3034,7 @@ function calendar_add_icalendar_event($event, $courseid, $subscriptionid, $timez
$eventrecord->courseid = $sub->courseid;
$eventrecord->eventtype = $sub->eventtype;

if ($updaterecord = $DB->get_record('event', array('uuid' => $eventrecord->uuid))) {
if ($updaterecord = $DB->get_record('event', array('uuid' => $eventrecord->uuid, 'subscriptionid' => $eventrecord->subscriptionid))) {
$eventrecord->id = $updaterecord->id;
$return = CALENDAR_IMPORT_EVENT_UPDATED; // Update.
} else {
Expand Down

0 comments on commit 4558358

Please sign in to comment.