From 455835809d2c65a69b1cbd196cf4694a54744a77 Mon Sep 17 00:00:00 2001 From: Stephen Bourget Date: Tue, 13 Dec 2016 21:36:08 -0500 Subject: [PATCH] MDL-55715 calendar: Only update events from the current subscription The iCal import should only update calendar events from the current subscription not any subscription that contains the same event. --- calendar/lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calendar/lib.php b/calendar/lib.php index 0ce9f1b5d54..f80a5df046f 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 {