[kronolith] kronolith_import and kronolith_replace broken

Karsten Fourmont fourmont at gmx.de
Mon Apr 5 06:11:40 PDT 2004


Hi,

kronolith_import and kronolith_replace used to work fine for me but since
version revision 1.02 they contain a line

        $event->setID($content->getAttribute('UID'));

$content does not (generally?) contain an attribute 'UID' and thus getAttribute
returns a Pear_Error. As a result the creation of the new event fails during
saving the event: an error object does not make a very good id...

I don't know why the $event->setID lines are required. They were introduced in
r1.102 with a cvs comment "Migrate functionality from Moment to Kronolith for
creating meetings, tracking attendees, and sending updates via iTip. Submitted
by:<s.binge at codefusion.co.za>"

On the other hand this might rather be a bug in
framework/iCalender/iCalender.php Horde_iCalender::getAttribute(): the inline
doc for this function says it's supposed to return false on nonexistant
attributes while in fact it returns a Pear_Error.

A Pear_Error is what the rest of the code (like Driver.php) seems to expect so
it might  be better to just change the doc in line 93 of iCalendar.php from

     * @return mixed (boolean) False if the attribute does not exist.
to
     * @return mixed (Pear_Error) Pear_Error if the attribute does not exist.

Then kronolith/lib/api.php requires the following change: line 230 from
        $event->setID($content->getAttribute('UID'));
to
        $id = $content->getAttribute('UID');
        if (!is_a($id, 'PEAR_Error')) {
            $event->setID($id);
        }

same for the other getAttribute call in line 367.

Can anyone with cvs write access verify this and then check it in?  Thanks

   Karsten





More information about the kronolith mailing list