Summary | All day events cause crash with Funambol outlook connector |
Queue | Synchronization |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | jan (at) horde (dot) org |
Requester | cocayden+horde (at) gmail (dot) com |
Created | 08/02/2009 (5813 days ago) |
Due | |
Updated | 08/21/2009 (5794 days ago) |
Assigned | 08/14/2009 (5801 days ago) |
Resolved | 08/21/2009 (5794 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
Assigned to Jan Schneider
State ⇒ Resolved
Maybe we should also add some comment in the source code why we do the
"mday--" for later readers ot the code?
Many thanks
I have included the DTSTART case in the getAllAttributes() loop again
to streamline the code and modified the DTEND case to use the same
formating as the DTSTART. The variable "$start" is only used to
compare against "$alarm" as far as i can see and this is working. The
"$end" is only used to compute "Duration" which is no SIF-E attribute
anyway as far as i can see??
that the DTSTART attribute is always before the other attributes that
depend on it. Beside that, the $start variable had been overwritten
inside the loop under certain circumstances.
/var/www/horde/lib/SyncML/Device/Sync4j.php on line 848
Undefined index: value in
/var/www/horde/lib/SyncML/Device/Sync4j.php on line 849
http://cvs.horde.org/diff.php/framework/SyncML/SyncML/Device/Sync4j.php?rt=horde&r1=1.8.2.28&r2=1.8.2.29&ty=u
I have included the DTSTART case in the getAllAttributes() loop again
to streamline the code and modified the DTEND case to use the same
formating as the DTSTART. The variable "$start" is only used to
compare against "$alarm" as far as i can see and this is working. The
"$end" is only used to compute "Duration" which is no SIF-E attribute
anyway as far as i can see??
--- lib/SyncML/Device/Sync4j.php.orig 2009-08-14 17:01:24.000000000 +0200
+++ lib/SyncML/Device/Sync4j.php 2009-08-19 16:26:18.000000000 +0200
@@ -829,7 +829,8 @@
$hash = array('ReminderSet' => 0,
'IsRecurring' => 0,
'BusyStatus' => 2);
- $alarm = null;
+ $alarm = $end = null;
+
foreach ($content->getAllAttributes() as $item) {
$GLOBALS['backend']->logMessage(
sprintf('Sync4j for name %s, value %s',
@@ -843,18 +844,19 @@
if (!empty($item['params']['VALUE']) &&
$item['params']['VALUE'] == 'DATE') {
$hash['AllDayEvent'] = 1;
- $hash['Start'] = sprintf('%04d-%02d-%02dT00:00:00Z',
- $item['value']['year'],
- $item['value']['month'],
- $item['value']['mday']);
+ $date = new Horde_Date(array('year' =>
$item['value']['year'],
+ 'month' =>
$item['value']['month'],
+ 'mday' =>
$item['value']['mday']));
+ $date->correct();
+ $hash['Start'] = $date->format('Y-m-d');
$start = mktime(0, 0, 0,
$item['value']['month'],
$item['value']['mday'],
$item['value']['year']);
} else {
$hash['AllDayEvent'] = 0;
- $hash['Start'] = Horde_iCalendar::_exportDateTime
- ($item['value']);
+ $hash['Start'] = Horde_iCalendar::_exportDateTime(
+ $item['value']);
$start = $item['value'];
}
break;
@@ -863,10 +865,12 @@
if (!empty($item['params']['VALUE']) &&
$item['params']['VALUE'] == 'DATE') {
$hash['AllDayEvent'] = 1;
- $hash['End'] = sprintf('%04d-%02d-%02dT00:00:00Z',
- $item['value']['year'],
- $item['value']['month'],
- $item['value']['mday']);
+ $date = new Horde_Date(array('year' =>
$item['value']['year'],
+ 'month' =>
$item['value']['month'],
+ 'mday' =>
$item['value']['mday']));
+ $date->mday--;
+ $date->correct();
+ $hash['End'] = $date->format('Y-m-d');
$end = mktime(0, 0, 0,
$item['value']['month'],
$item['value']['mday'],
@@ -983,13 +987,7 @@
$hash['DayOfWeekMask'] = $mask;
} else {
$hash['RecurrenceType'] = 2;
- $start = $content->getAttribute('DTSTART');
- if (!empty($start['params']['VALUE']) &&
- $start['params']['VALUE'] == 'DATE') {
- $hash['DayOfMonth'] = $start['value']['mday'];
- } else {
- $hash['DayOfMonth'] = date('j', $start);
- }
+ $hash['DayOfMonth'] = date('j', $start);
}
break;
on line 848
Undefined index: value in /var/www/horde/lib/SyncML/Device/Sync4j.php
on line 849
Which means the following lines ...
+ $hash['Start'] =
Horde_iCalendar::_exportDateTime($start['value']);
+ $start = $start['value'];
working as it seams???
Lead to "Undefined Index: value" and some strange Start Date :
Output converted for client (text/x-s4j-sife):
<?xml
version="1.0"?><appointment><ReminderSet>0</ReminderSet><IsRecurring>0</IsRecurring><BusyStatus>2</BusyStatus><AllDayEvent>1</AllDayEvent><Start>19700101T000000Z</Start><End>2009-08-19</End><Subject>TEST-1</Subject><Sensitivity>0</Sensitivity></appointment>
Why not simply use the same code as for the End-Date as this is
working as it seams???
http://cvs.horde.org/diff.php/framework/SyncML/SyncML/Device/Sync4j.php?rt=horde&r1=1.8.2.26&r2=1.8.2.27&ty=u
For the lines
+ $hash['Start'] =
Horde_iCalendar::_exportDateTime($item['value']);
+ $start = $item['value'];
I get a "Undefined variable: item"
and for
+ $hash['End'] = $date->sprintf('%04d-%02d-%02d');
a "call to undefined method Horde_Date::sprintf()"
in the logfile.
My Horde Version is 3.3.4.
really has to be fixed there, but at least we have some hints how to
work around it now.
Try what I committed.
http://cvs.horde.org/diff.php/framework/SyncML/SyncML/Device/Sync4j.php?rt=horde&r1=1.8.2.25&r2=1.8.2.26&ty=u
http://cvs.horde.org/diff.php/framework/SyncML/SyncML/Device/Sync4j.php?rt=horde&r1=1.64&r2=1.65&ty=u
New Attachment: bug-8474.zip
Outlook-receive-allday.txt lead to crash of the Funambol Outlook Plugin
Outlook-sent-allday.txt is what the same Plugin sent when the event is
created in Outlook
It seams that the SIF-E does not like full date/times in case of
AllDayEvent maybe because AllDayEvent means the whole day and not
lasting 24 hours in Outlook world, so the time part is pointless anyway.
Next in SIF-E Start and End Day have to be the same for a one Day
event, otherwise it is translated to a two day event as addressed
Bug#6847.As the SIF-E is solely to Funambol we could simply hack Sync4j.php to
follow there "rules", or check version number of the Funambol Plugin
and use "vcalendar 1.0" instead if the version is >= 7...
State ⇒ Feedback
client, that matches the rules of the Kronolith event that causes the
client to crash?
would be a misshandling of there own format?
State ⇒ Not A Bug
Unless we did something wrong in the iCalendar implementation (and
this change was actually required to *fix* a broken implementation),
there is nothing we could do.
Bug #6847)@@ -840,7 +843,7 @@ class SyncML_Device_sync4j extends SyncM
if (!empty($item['params']['VALUE']) &&
$item['params']['VALUE'] == 'DATE') {
$hash['AllDayEvent'] = 1;
- $hash['Start'] = sprintf('%04d-%02d-%02d',
+ $hash['Start'] = sprintf('%04d-%02d-%02dT00:00:00Z',
$item['value']['year'],
$item['value']['month'],
$item['value']['mday']);
@@ -858,9 +861,9 @@ class SyncML_Device_sync4j extends SyncM
case 'DTEND':
if (!empty($item['params']['VALUE']) &&
- $item['params']['VALUE'] == "DATE") {
+ $item['params']['VALUE'] == 'DATE') {
$hash['AllDayEvent'] = 1;
- $hash['End'] = sprintf('%04d-%02d-%02d',
+ $hash['End'] = sprintf('%04d-%02d-%02dT00:00:00Z',
Seams Funambol does not like too many zeros :-(
SyncML. The Plugin crashes with the "send report to MS" message and
that's it. It occurs as soon as a reccuring event should be synced
with all versions of the Outlook Funambol Plugin up to 8.0.4
State ⇒ Feedback
Milestone ⇒
Priority ⇒ 2. Medium
State ⇒ Unconfirmed
Patch ⇒ No
Milestone ⇒ Webmail edition 1.2.3
Summary ⇒ All day events cause crash with Funambol outlook connector
Type ⇒ Bug
Queue ⇒ Synchronization
the next day from horde.
The events are usually public holidays(New Years Day etc) that are
automatically added by outlook.
The events when export to csv look like
New Year's Day Holiday Australia 1/01/2008 0:00:00 2/01/2008 0:00:00 0
This occurs for recurring events as well.
I am running centos 5.3 with horde webmail edition 1.2.3. Using
Funambol outlook connector 7.2.
The debug information from /tmp/sync/log.txt for an event is below:
DEBUG: Sync4j for name DTSTAMP, value 1248955555
DEBUG: Sync4j for name CREATED, value 1248955444
DEBUG: Sync4j for name LAST-MODIFIED, value 1248502388
DEBUG: Sync4j for name SUMMARY, value New Year's Day
DEBUG: Sync4j for name ORGANIZER, value mailto:xxx@xxx.com
DEBUG: Sync4j for name CATEGORIES, value Holiday
DEBUG: Sync4j for name LOCATION, value Australia
DEBUG: Sync4j for name CLASS, value PUBLIC
DEBUG: Sync4j for name STATUS, value CONFIRMED
DEBUG: Sync4j for name TRANSP, value OPAQUE
DEBUG: Created device class SyncML_Device_Sync4j
DEBUG: Sending add from server:
040000008200E00074C5B7101A82E00800000000705EEB086CEEC701000000000000000010000000122B51157EE4734EA7DC47716CD028AC
DEBUG: Sync4j for name DTSTART, value array (
'year' => '2008',
'month' => '01',
'mday' => '01',
)
DEBUG: Sync4j for name DTEND, value array (
'year' => '2008',
'month' => '01',
'mday' => '02',
)