Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

ICS iCal importing, $content on the Event Calendar Module


Go to End


6 Posts   3029 Views

Avatar
3pointross

Community Member, 19 Posts

18 November 2009 at 8:37am

I am trying to import a feed of announcements but I am having a but of trouble getting it to render properly.

You can see what is going on here -> http://howellv2.stagedsite.net/

Everything looks great but the content ends prematurely and we are getting a bunch of '\' characters as well.

Any help / insight would be great

Avatar
UncleCheese

Forum Moderator, 4102 Posts

18 November 2009 at 9:29am

Nice site!

I see all the events in the right hand column. Is there something I'm missing? Also, make sure there's no HTML in your ICS feed. I'm not sure that I'm filtering the ICS content for HTML at this point.

Avatar
3pointross

Community Member, 19 Posts

19 November 2009 at 1:47am

Thanks for the response UncleCheese, much appreciated.

If you look at the descriptions below any given listing, it only outputs a line or two before it ends. For example "Don't miss the traditional start of the holiday season in the H" is maybe only 1/3rd of the total description on the calendar but thats all that gets rendered on the page.

The descriptions don't have any HTML at this point. It looks like (my guess) for some reason google has manual line breaks in long descriptions and because the ICS is parsed with explode("\r\n" it thinks that is the end of the description?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

19 November 2009 at 3:46am

Yeah, that's a very unfortunate bug in the ICS import class I'm using. It's all line-break based, so if your description has one, it ends the field there. I tried for a while to give it some new logic to tolerate line-breaks circumstantially, but I just couldn't make it work. If you're a programmer, look at that ICSReader (?) class and see what you can come up with. I'd really love to fix this.

Avatar
coffeymachine

Community Member, 10 Posts

23 December 2009 at 9:58am

I have found a quick workaround to this problem.

1. Open up the event_calendar/code/iCal.php file
2. Uncomment lines 42-44 (as of revision 83)
3. On line 42 replace "END:VEVENT" with whatever comes right after the end of your description in your .ics file. I am importing from Google Calendar, so for me I put "LAST-MODIFIED". You will need to open up the .ics file you are importing and see what comes after the description.

This may not work if you are importing .ics files from different sources with slightly different formats, but I am only importing from Google Calendar so this does the trick. If anyone can find a better fix for this please let me know.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

23 December 2009 at 10:54am

That's a great fix. Thanks. It's true that the varying sources of ICS outputs is the most problematic issue with the imports. ICS is supposed to be a standardized format, but there's so little information about it. You'd think this stuff would have been figured out by now.