• Hello a number of our users (https://stockwoodparkrfc.co.uk) reported having issues where the calendar feeds were not updating when changes were made to fixtures on certain devices/software. One example was BusyCal on the Mac and also some versions of android operating system. After some research we discovered that some software/devices not only look at the date last updated in the Ical but also look at the E-tag in the page header before they look at the date updated on each record in the Ical. This is to stop unnecessary scanning of each record to see if changed. So – E-tag is checked first (E-tag is MD5 hash of output) and if different from previous then check each record to see if updated.

    We made this change to get this working in the ical.php file in the feeds folder.

    —-start of code snippet from ical.php

    // End output
    $output .= “END:VCALENDAR”;

    // Print headers
    header(‘Content-type: text/calendar; charset=utf-8’);

    // ***Modification Start
    // The E-Tag is not being changed when the output file is generated – Some Webdav clients do not like this and
    // do not then ‘see’ that the file has changed – updates to the calendars are then not displayed to the user.

    $etag = md5($output);
    header(‘Etag:’ . ‘”‘.$etag.'”‘);

    // ***Modification End

    header(‘Content-Disposition: inline; filename=’ . $post->post_name . ‘.ics’);

    // Print content
    echo $output;

    ——–end of code snippet from ical.php

    Can we get this included as standard – assuming we haven’t broken anything else by doing this. ??

    • This topic was modified 7 years, 4 months ago by garygomm.
    • This topic was modified 7 years, 4 months ago by garygomm.
    • This topic was modified 7 years, 4 months ago by garygomm.
    • This topic was modified 7 years, 4 months ago by garygomm.
Viewing 6 replies - 16 through 21 (of 21 total)
  • Thread Starter garygomm

    (@garygomm)

    understood. What you could try and do is copy and paste already existing single and double quotes from other parts of the code into the modded bit.

    But, keep in mind that code only solves the issues with some software (mac 3rd party calendar software – BusyCal and some android devices/os.

    As far as I know we never experienced the issue with the standard Mac calendars and IOS not updating – as long as you subscribed as Local Calendar and not Icloud location when you add the subscription. That code only solves the issue for those 3rd party Mac apps and some android apps/devices that use the tag to determine ifes there has been a change.

    So i think you Mac calendar and IOS is not related to the code. Post feed link here and I will subscribe and then ask you to change an entry – I will then see if I see the change in the feed and on my mac – that would then narrow down where the problem is….maybe ??

    SUCCESS!!
    on my test site, setup a calendar, added the modification code and on Mac and iOS it has indeed refreshed/updated.
    It looks as though Google will not / may! not but this is a very valuable update.
    Thank you so much for your patient help and of course the mod code!!

    All the best.

    And yes I think I had actually subscribed to the iCloud initially which clouded the issue (get it;) ). All good, lots learnt!

    Thread Starter garygomm

    (@garygomm)

    Excellent news! If you ever figure out what the issue with Google is drop a note in here. I will do the same if I ever find it!

    Thanks

    Roch

    (@rochesterj)

    Hi guys!

    This was sent to our dev team as well and they liked the idea ??

    Hopefully this (or something similar) will be implemented in the next update.

    Thanks!

    Kind Regards,
    -Roch

    Plugin Author Brian

    (@brianmiyaji)

    This is a great solution, thanks @garygomm! It’s been added to core for version 2.5: https://github.com/ThemeBoy/SportsPress/commit/585e791113dcb8bba39f6911481612aa9142bbb8

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Calendar feed issue – Ical not updating after change’ is closed to new replies.