Skip to content

Commit

Permalink
Correctly handle recurrence exceptions in calendar/replace method.
Browse files Browse the repository at this point in the history
Bug: 13399
  • Loading branch information
mrubinsk committed Jul 29, 2014
1 parent cdaf2b6 commit ffbfd88
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions kronolith/lib/Api.php
Expand Up @@ -1118,11 +1118,16 @@ public function replace($uid, $content, $contentType, $calendar = null)
}
}

$event->fromiCalendar($component);
// Ensure we keep the original UID, even when content does not
// contain one and fromiCalendar creates a new one.
$event->uid = $uid;
$event->save();
try {
$rid = $component->getAttribute('RECURRENCE-ID');
$this->_addiCalEvent($component, Kronolith::getDriver(null, $calendar), true);
} catch (Horde_Icalendar_Exception $e) {
$event->fromiCalendar($component);
// Ensure we keep the original UID, even when content does not
// contain one and fromiCalendar creates a new one.
$event->uid = $uid;
$event->save();
}
}

/**
Expand Down

0 comments on commit ffbfd88

Please sign in to comment.