Bug 172246

Summary: creates invalid icalendar files
Product: [Applications] kdepimlibs Reporter: Jiri Palecek <jpalecek>
Component: kcalAssignee: David Jarvie <djarvie>
Status: CLOSED FIXED    
Severity: normal    
Priority: NOR    
Version: 4.1   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Bad calendar produced by kalarm
A working calendar

Description Jiri Palecek 2008-10-06 01:17:46 UTC
Version:            (using KDE 4.1.2)
OS:                Linux
Installed from:    Debian testing/unstable Packages

When I defer a 2-week recurring event for one hour and close kalarm, the deferred alarm won't fire. I found out this is because kalarm writes incorrect kalarm files, particularly, in that case, the deferral would have


which is an invalid value for duration (the icalendar spec says a duration using W cannot have anything else - that means -P2W is legal, -P12DT1H12M too, -P2WT1S is not).

This causes an error while this value is read from the file on the next restart, and missing the alarm. (see file icalduration.c in libical sources)

Feel free to reassign this bug to kdepimlibs, if it is appropriate.
Comment 1 Jiri Palecek 2008-10-06 01:20:01 UTC
Created attachment 27706 [details]
Bad calendar produced by kalarm

Should fire the deferral alarm anytime between ~3 Oct and 15 Oct
Comment 2 Jiri Palecek 2008-10-06 01:21:40 UTC
Created attachment 27707 [details]
A working calendar

A calendar with a corrected value. Actually fires the alarm
Comment 3 David Jarvie 2008-10-06 10:54:40 UTC
This is a bug in libkcal (icalformat_p.cpp) whereby it writes a duration value containing a weeks value mixed with a days/time value, contrary to RFC2445. When it tries to read the duration back again, libical correctly rejects this mixed value, so that the value written can't be read back again.

This has already been fixed by SVN commits 865198, 865199, 865203, 865204 to both KDE 4.1 branch and trunk. Unfortunately the fix was just too late to be included in KDE 4.1.2.