Currently the output from template_preprocess_date_vcalendar() doesn't allow the calendar_ical module to output RFC 2445 compliant ical files. I will be logging the calendar module issue separately.
This patch adds a new theme variable current_date_utc which is the current time in UTC. The variable is used for output in the DTSTAMP field of VEVENT entries. The old current_date variable is retained for backwards compatibility and can probably be dropped in the future.
Currently the output for calendar entries is run through htmlentities, which leads to escaped entities being rendered in rendered in iCalendar clients, which isn't a good look. As an iCalendar file isn't html, the entities should not be escaped.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | date-760284-rfc-fixes.diff | 3.76 KB | arithmetric |
| #14 | date-760284-rfc-fixes-14.diff | 3.76 KB | skwashd |
| #6 | date-760284-rfc-fixes.diff | 2.97 KB | skwashd |
| #3 | patch-760284-fix-template_preprocess_date_vcalendar.diff (correct patch) | 1021 bytes | skwashd |
| cal-ical-rfc2445-compliance-fix.diff | 4.09 KB | skwashd |
Comments
Comment #1
skwashd commentedThis needs to be applied before #760316: calendar_ical isn't RFC compliant applied to the calendar module.
Comment #2
domesticat commentedSee my comment here: http://drupal.org/node/760316#comment-2816684
There's duplication between the two patches; if you try to run them as the author suggests, you'll see errors.
Comment #3
skwashd commentedSorry I uploaded the same patch to both issues, rather than the date patch here. Please try again with the new patch.
Comment #4
skwashd commentedforgot to update the status back to needs review
Comment #5
domesticat commentedLooks good here! I'd get another set of eyes on it just to be sure.
Comment #6
skwashd commentedSome additional fixes were needed here to fix issues in the calendar/calendar_ical module. I have also fixed theme/date-vevent.tpl.php so it is the same as calendar_ical/calendar-view-ical.tpl.php Once this is all sorted out I might look at calendar_ical using the themeing from date to reduce duplication and to make things easier to maintain.
If testing the the calendar fixes using the patch on #760316: calendar_ical isn't RFC compliant this patch needs to be applied for it to work.
I think this is right to go once someone checks it.
Comment #7
Macronomicus commentedIve tested this and it works in combination with http://drupal.org/node/760316#comment-2828580 to make google and other calendars happy with the ical yay!! Now if we could just get google to to updates more frequently than 3 hours or have a refresh button! damn ... its a pita when your working on the output.
Switching this to rtbc!
Cheers!
Comment #8
stephenhendry commentedsubscribe
Comment #9
shambler commentedI'm still getting errors after applying the patches:
Error: Error was: Error at line 10: [DTSTART] Unparseable date: "VALUE=DATE-TIME:20100520T090000"
Cause: Caused by: [DTSTART] Unparseable date: "VALUE=DATE-TIME:20100520T090000
10: DTSTART;TZID=Europe/London:VALUE=DATE-TIME:20100520T090000
11: DTEND;TZID=Europe/London:VALUE=DATE-TIME:20100520T170000
Probably my fault as I had to manually edit the patches. Unless it's something to configure im views?
Comment #10
shambler commentedAnd indeed it was my error.
Feed validates at http://severinghaus.org/projects/icv/
http://icalvalid.cloudapp.net/ not responding at the moment.
And I should add many thanks for this!!
Comment #11
SyneX commentedThank you for the patch. Now it's working for me in Google calendar. Don't forget to clear the Drupal cache after applying the patch.
Comment #12
karens commentedSo the linked issue on the Date issue queue says the patch is ready to be committed and the one on the Calendar module says patch needs work, but the note says both need to go in together. If that one is not ready, this one is not ready.
If someone can figure out what the other patch should be and confirm that it is working and RTBC, then you can come back and mark this one RTBC too.
Comment #13
skwashd commentedThis is an updated version of the patch as there is some cross dependencies between the modules and patches. Please test inconjunction with #760284
Comment #14
skwashd commentedAnd this time with the updated patch. This is against the CVS branch as of earlier today.
Comment #15
arithmetric commentedI'm reviewing this patch to solve timezone issues with Outlook clients. I found one syntax fix for your patch that I wanted to submit. I'll follow up after additional testing.
Comment #16
arithmetric commentedWith the updated patch I posted in the associated Calendar module issue (http://drupal.org/node/760316#comment-3535008), this solves the compatibility problems I was having with ical files.
Comment #17
IcyAndy commented- Patch applies to latest CSV code as per 14.10.2010 (Version 6.x-2)
- Also applied patch #760316: calendar_ical isn't RFC compliant
- Checked line ending changes (CR LF) with RFC 5545. Care must be taken when editing .tpl files in future to preserve CR LF endings
- Patch does not deal with line folding as per RFC 5545, 3.1. As this is a "SHOULD" requirement it is not strictly necessary.
Tested with Thunderbird (lightning extension) and http://severinghaus.org/projects/icv/ but not with http://icalvalid.cloudapp.net as the validator is not reachable most of the time (at least for me, though other cloudapp.net sites work).
Recurring events have been tested only with one test case but this patch does not change handling of recurring events and therefore should be fine.
Comment #18
ekes commented#15 with #760316: calendar_ical isn't RFC compliant #30 as described in #17.
Working, and validating on http://icalvalid.cloudapp.net too. Argee with #17 RTBC.
Comment #19
karens commentedCommitted this and the calendar patch. If more is needed, please start a new issue because this whole thing is getting pretty confusing.