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.

Comments

skwashd’s picture

This needs to be applied before #760316: calendar_ical isn't RFC compliant applied to the calendar module.

domesticat’s picture

Status: Needs review » Needs work

See 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.

skwashd’s picture

Sorry I uploaded the same patch to both issues, rather than the date patch here. Please try again with the new patch.

skwashd’s picture

Status: Needs work » Needs review

forgot to update the status back to needs review

domesticat’s picture

Looks good here! I'd get another set of eyes on it just to be sure.

skwashd’s picture

StatusFileSize
new2.97 KB

Some 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.

Macronomicus’s picture

Status: Needs review » Reviewed & tested by the community

Ive 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!

stephenhendry’s picture

subscribe

shambler’s picture

I'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?

shambler’s picture

And 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!!

SyneX’s picture

Thank 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.

karens’s picture

Status: Reviewed & tested by the community » Needs work

So 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.

skwashd’s picture

Status: Needs work » Needs review

This is an updated version of the patch as there is some cross dependencies between the modules and patches. Please test inconjunction with #760284

skwashd’s picture

Version: 6.x-2.4 » 6.x-2.x-dev
StatusFileSize
new3.76 KB

And this time with the updated patch. This is against the CVS branch as of earlier today.

arithmetric’s picture

StatusFileSize
new3.76 KB

I'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.

arithmetric’s picture

With 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.

IcyAndy’s picture

Status: Needs review » Reviewed & tested by the community

- 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.

ekes’s picture

#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.

karens’s picture

Status: Reviewed & tested by the community » Fixed

Committed this and the calendar patch. If more is needed, please start a new issue because this whole thing is getting pretty confusing.

Status: Fixed » Closed (fixed)
Issue tags: -RFC compliance, -ical

Automatically closed -- issue fixed for 2 weeks with no activity.