diff --git a/calendar/lib.php b/calendar/lib.php index 0ce9f1b5d54c6..f80a5df046f40 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -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 {