Menu

#2315 Allday events cause lightning to fail with 0x8000fff

open
nobody
None
5
2013-01-14
2008-05-08
No

RFC2445 allows the following in an ical event:

DTEND;VALUE=DATE-TIME:

However, Webcalendar v1.2.b1 generates the following for an all day event:

DTEND;VALUE=DATETIME:

This causes Lightning 0.8 (and I guess Sunbird 0.8) to fail with:

Error number: 0x8000fff
Description: [Exception... "Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [calIIcalComponent.endTime]" nsresult: "0x8000ffff (NS_ERROR_UNEXPECTED)" location: "JS frame :: file:///home/graham/.thunderbird/gf3ux0x5.default/extensions/%7Be2fda1a4-762b-4020-b5ad-a41df1933103%7D/js/calItemBase.js :: anonymous :: line 548" data: no]

Webcalendar v1.2.b1 can be fixed by applying the following patch to xcal.php:

--- xcal.php 2008-05-08 19:36:36.000000000 +0100
+++ xcal.php.fix 2008-05-08 19:36:36.000000000 +0100
@@ -203,7 +203,7 @@
if ( $insert_vtimezone = get_vtimezone ( $TIMEZONE, $dtstart ) )
$ret .= 'DTSTART;TZID=' . $TIMEZONE . ':' . $dtstart. "\r\n";
else
- $ret .= 'DTSTART;VALUE=DATETIME:' . $dtstart. "\r\n";
+ $ret .= 'DTSTART;VALUE=DATE-TIME:' . $dtstart. "\r\n";
$startHasTime = 1;
} else if ( $time == -1 ) {
// untimed event: this is the same regardless of timezone. For example,
@@ -223,7 +223,7 @@
if ( $time == 0 && $duration == 1440 ) {
// all day event: better to use end date than duration since
// duration will be 23hr and 25hrs on DST switch-over days.
- $ret .= 'DTEND;VALUE=' . ( $startHasTime ? 'DATETIME' : 'DATE' ) .
+ $ret .= 'DTEND;VALUE=' . ( $startHasTime ? 'DATE-TIME' : 'DATE' ) .
':' . gmdate ( 'Ymd', $eventend ) .
( $startHasTime ? 'T000000' : '' ) . "\r\n";
}

Some comments in xcal.php imply that Sunbird 0.7 expects DATETIME, so it could be that some users need to upgrade to a later version of Sunbird after this patch has been applied.

Discussion

  • Graham Short

    Graham Short - 2008-05-08

    Logged In: YES
    user_id=200153
    Originator: YES

    File Added: xcalpatch

     
  • Graham Short

    Graham Short - 2008-05-08

    Patch to xcal.php

     
  • Stefan Sitter

    Stefan Sitter - 2008-06-06

    Logged In: YES
    user_id=2109996
    Originator: NO

    Per Lightning bug report 437645 <https://bugzilla.mozilla.org/show_bug.cgi?id=437645> I can confirm this behavior. The .ics files created by WebCalendar violate the iCalendar specification <http://tools.ietf.org/html/draft-ietf-calsify-rfc2445bis-08#section-3.3.5> and are invalid.

     
  • Uwe Trenkner

    Uwe Trenkner - 2008-09-11

    I ran into the same problem and thought it was a problem in Lighting, see my Bugreport at https://bugzilla.mozilla.org/show_bug.cgi?id=445480.

    Now, Bas von den Bosch thankfully pointed out that my problem was due to the wrong use of DATETIME.

    I searched-and-replaced xcal.php (DATETIME->DATE-TIME) and now it seems perfectly to work also for all-day events.

    Because this is so trivial to replace, I do not attach a diff here.

    Anyway, thanks for the good software!
    Uwe.

     
  • Uwe Trenkner

    Uwe Trenkner - 2008-09-11

    I ran into the same problem and thought it was a problem in Lighting, see my Bugreport at https://bugzilla.mozilla.org/show_bug.cgi?id=445480.

    Now, Bas von den Bosch thankfully pointed out that my problem was due to the wrong use of DATETIME.

    I searched-and-replaced xcal.php (DATETIME->DATE-TIME) and now it seems perfectly to work also for all-day events.

    Because this is so trivial to replace, I do not attach a diff here.

    Anyway, thanks for the good software!
    Uwe.

     

Log in to post a comment.