Kronolith doesn't reset empty attributes from Outlook+Funambol
Alfonso Marín Marín <[email protected]>
| Newsgroups | gmane.comp.horde.sync |
|---|---|
| Message-ID | <[email protected]> |
Hi, Syncing Outlook with Kronolith, i have noticed that if you delete an existing alarm from an event in Outlook, after synchronization it still remaining in kronolith, but not in outlook. Playing with other event attributes i can see that attributes like "location" or "description" still remaining at server side (kronolith) every time you delete them completely in Outlook. Looking at code i can see that it happens because an event is updated using driver->fromiCalendar method using the iCalendar info given by Sing4j->sif2vevent. The problem here is that sif2vevent function doesn't generate an iCalendar attribute for empty fields, so fromiCalendar function ignores those attributes. I think that fromiCalendar function should reset every non existing attribute. I don't know if that has other effects. I attach a patch to show what i'm suggesting Other solution would be to ensure that sif2vevent generates an vEvent with all attributes even if some of them are empty. -- Alfonso Marín Marín Sección de Telemática - ATICA Universidad de Murcia -- sync mailing list - Join the hunt: http://horde.org/bounties/#sync Frequently Asked Questions: http://horde.org/faq/ To unsubscribe, mail: [email protected]
Driver.php.patch
(text/x-diff, 1.3 KB)
Index: Driver.php
===================================================================
RCS file: /repository/kronolith/lib/Driver.php,v
retrieving revision 1.303
diff -u -r1.303 Driver.php
--- Driver.php 24 Oct 2008 21:10:06 -0000 1.303
+++ Driver.php 20 Mar 2009 12:56:28 -0000
@@ -848,18 +848,24 @@
$desc = $vEvent->getAttribute('DESCRIPTION');
if (!is_array($desc) && !is_a($desc, 'PEAR_Error')) {
$this->setDescription($desc);
+ } else {
+ $this->setDescription('');
}
// Remote Url
$url = $vEvent->getAttribute('URL');
if (!is_array($url) && !is_a($url, 'PEAR_Error')) {
$this->remoteUrl = $url;
+ } else {
+ $this->remoteUrl = '';
}
// Location
$location = $vEvent->getAttribute('LOCATION');
if (!is_array($location) && !is_a($location, 'PEAR_Error')) {
$this->setLocation($location);
+ } else {
+ $this->setLocation('');
}
// Class
@@ -947,8 +953,11 @@
!is_a($alarm, 'PEAR_Error') &&
intval($alarm)) {
$this->alarm = intval(($this->start->timestamp() - $alarm) / 60);
+ } else {
+ $this->alarm = 0;
}
+
// @TODO: vCalendar 2.0 alarms
// Attendance.