Skip to content

Commit

Permalink
Bug: 13512 Update the exceptionoriginaldate field when base event cha…
Browse files Browse the repository at this point in the history
…nges.
  • Loading branch information
mrubinsk committed Aug 30, 2014
1 parent 8aee9fb commit 81968fb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions kronolith/lib/Driver.php
Expand Up @@ -351,8 +351,19 @@ protected function _listEvents(
public function saveEvent(Kronolith_Event $event)
{
if ($event->stored || $event->exists()) {
// If this event recurs and has bound exceptions, we must make sure
// that the exceptionoriginaldate is updated in those exceptions as
// well. See Bug: 13512
if ($event->recurs()) {
foreach ($event->boundExceptions() as $bound) {
$t = $event->start->strftime('%T');
$bound->exceptionoriginaldate = new Horde_Date($bound->start->strftime('%Y-%m-%d') . 'T' . $t);
$bound->save();
}
}
return $this->_updateEvent($event);
}

return $this->_addEvent($event);
}

Expand Down

0 comments on commit 81968fb

Please sign in to comment.