[Tickets #9423] Error in delete API call when exists multiple events with same UID
bugs at horde.org
bugs at horde.org
Thu Dec 2 13:12:50 UTC 2010
DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.
Ticket URL: http://bugs.horde.org/ticket/9423
------------------------------------------------------------------------------
Ticket | 9423
Created By | almarin at um.es
Summary | Error in delete API call when exists multiple events
| with same UID
Queue | Kronolith
Version | FRAMEWORK_3
Type | Bug
State | Unconfirmed
Priority | 1. Low
Milestone |
Patch |
Owners |
------------------------------------------------------------------------------
almarin at um.es (2010-12-02 08:12) wrote:
In _kronolith_delete($uid) function, it sometimes give an error
deleting an event which has some copies with the same UID.
After calling getByUID with getAll flag set to true, kronolith_driver
remain open the last calendar which have a copy of the event because
of this loop:
$eventArray = array();
foreach ($events as $event) {
$this->open($event['calendar_id']);
$this->_cache[$this->_calendar][$event['event_id']] =
&new Kronolith_Event_sql($this, $event);
$eventArray[] =
&$this->_cache[$this->_calendar][$event['event_id']];
}
if ($getAll) {
return $eventArray;
}
The calendar_id could not be the same as the calendar of the copy
which finally is selected, so the last
$kronolith_driver->deleteEvent($event->getId()) call fails.
A solution could be opening the event's calendar before deleting it:
$kronolith_driver->open($event->getCalendar());
return $kronolith_driver->deleteEvent($event->getId());
Any way, i think that getByUID shouldn't leave open any calendar when
getAll flag is true, and ensure that opened calendar id is the same as
the one of the event returned when getAll flag is false.
Regards
More information about the bugs
mailing list