Summary | Error in delete API call when exists multiple events with same UID |
Queue | Kronolith |
Queue Version | FRAMEWORK_3 |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | jan (at) horde (dot) org |
Requester | almarin (at) um (dot) es |
Created | 12/02/2010 (5301 days ago) |
Due | |
Updated | 07/02/2011 (5089 days ago) |
Assigned | |
Resolved | 07/02/2011 (5089 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
State ⇒ Resolved
MFH: Make sure the calendar is opened that we get the event from (
Bug #9423).http://cvs.horde.org/diff.php/kronolith/lib/api.php?rt=horde&r1=1.126.2.67&r2=1.126.2.68&ty=u
Make sure the calendar is opened that we get the event from (
Bug #9423).1 files changed, 1 insertions(+), 0 deletions(-)
http://git.horde.org/horde-git/-/commit/386adb3fc1f14ee260b909db957fcaec1031fa3b
Priority ⇒ 1. Low
Patch ⇒ No
Milestone ⇒
Queue ⇒ Kronolith
Summary ⇒ Error in delete API call when exists multiple events with same UID
Type ⇒ Bug
State ⇒ Unconfirmed
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