[Tickets #5980] Import of events via sync fails caused by empty uid

bugs at bugs.horde.org bugs at bugs.horde.org
Sun Dec 9 17:10:56 UTC 2007


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=5980
-----------------------------------------------------------------------
 Ticket             | 5980
 Created By         | xk3 at mompl.org
 Summary            | Import of events via sync fails caused by empty uid
 Queue              | Kronolith
 Version            | 2.2-RC1
 Type               | Bug
 State              | Unconfirmed
 Priority           | 3. High
 Owners             | 
-----------------------------------------------------------------------


xk3 at mompl.org (2007-12-09 09:10) wrote:

Doing a trace:

$item is a SyncML_SyncElement Object
(
    [_elementType] => Add
    [_cuid] => 22
    [_contentType] => 
    [_content] => BEGIN:VCALENDAR
VERSION:1.0
BEGIN:VEVENT
UID:09122007151253499125-0
[snip]

coming from horde sync and doing a krontolith import via api
/horde/kronolith/lib/api.php
    function _kronolith_import($content, $contentType, $calendar = null) 
        [snip]
        $event->fromiCalendar($content); 

The $item itself contains an UID, but it got stripped for $content by
horde sync.
/horde/kronolith/lib/Driver.php 
    function fromiCalendar($vEvent) in 
        $uid = $vEvent->getAttribute('UID'); 
        if (!empty($uid) && !is_a($uid, 'PEAR_Error')) { 
            $this->setUID($uid); 
        } 

Thus, $uid is empty! Now, back in import:
     $event->setCalendar($calendar); 
     // Check if the entry already exists in the data source, first 
     // by UID. 
     $uid = $event->getUID(); 
     $existing_event = &$kronolith_driver->getByUID($uid);


/horde/kronolith/lib/Driver/sql.php
    function &getByUID($uid, $getAll = false)  
        $query = [snip] ' FROM ' . $this->_params['table'] . ' WHERE
event_uid = ?';
        $values = array($uid);
        $events = $this->_db->getAll($query, $values,
DB_FETCHMODE_ASSOC);

BUT: $uid is not set, so $values does not match amount of placeholders,
query dies, next line not reached. This is the show stopper: if $uid is
manually set to whatever, events get imported.




More information about the bugs mailing list