Jump to:

10979 Posts in 2722 Topics by 1815 members

All other Modules

SilverStripe Forums » All other Modules » [SOLVED] Event Calendar ics trouble in SS 2.4

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 990 Views
  • 3dgoo
    Avatar
    Community Member
    133 Posts

    [SOLVED] Event Calendar ics trouble in SS 2.4 Link to this post

    Hello,

    I've noticed .ics files do not work properly on Silverstripe 2.4.x for me. The ics files download, but the browser seems to treat them as html files. And when a calendar program tries to open the file it does not import the calendar event at all.

    This is even happening on the event calendar demo for me:
    http://eventcalendar.bluehousegroup.com/basic-calendar/

    My sites with Silverstripe 2.3.x do not have this issue.
    Is anyone else having this issue?

    Cheers

  • UncleCheese
    Avatar
    4085 Posts

    Re: [SOLVED] Event Calendar ics trouble in SS 2.4 Link to this post

    I think it depends on your browser. For me, those ICS files download to iCal in Safari, but an older browser like IE may not know what to do with that content type.

    --------------------
    SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

  • 3dgoo
    Avatar
    Community Member
    133 Posts

    Re: [SOLVED] Event Calendar ics trouble in SS 2.4 Link to this post

    I'm testing in Firefox 6, Chrome 13, IE9. I don't know which browser my client is using, but they are having the same issue.

    The weird thing is on 2.3 installs the ics files work fine, but on 2.4 installs the ics files aren't recognised as ical data. The contents of the files are the same in each.

  • Fremmedkar
    Avatar
    Community Member
    1 Post

    Re: [SOLVED] Event Calendar ics trouble in SS 2.4 Link to this post

    SilverStripe seems to override the content-type of headers that are not set by SilverStripe's own header functions. Adding the following line to the top of your ics action in the Calendar_Controller class of Calendar.php should give you the correct header:

    $this->getResponse()->addHeader('Content-Type', 'text/calendar');

    The same goes for the new ical action and the rss action, but with "text/xml" or "application/rss+xml" as the content type for rss.

  • 3dgoo
    Avatar
    Community Member
    133 Posts

    Re: [SOLVED] Event Calendar ics trouble in SS 2.4 Link to this post

    Wow. Thank you very much. That worked perfectly.

    Cheers

    990 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.