Add to Cal for repeating dates

Created on 13 April 2015, almost 10 years ago
Updated 8 February 2023, about 2 years ago

Hi,

Thank you for the module. I am experiencing some issues implementing AddtoCal for repeating dates. Wondering if anyone else has this implemented without the below issues.

I have Add to Cal format selected for a repeating date field in the display settings for an event content type. In the display settings for the field, when I enter 'now' in the starting from option (so that only future dates are shown for the event), select 'Show repeat rule' under Repeat rule(please see attached screenshot) and save the settings, I see the below errors and nothing else when I go to an individual event page.

Warning: array_key_exists() expects parameter 2 to be array, null given in addtocal_extract_event_info() (line 414 of /var/www/mysite/sites/all/modules/contrib/addtocal/addtocal.module).
Exception: DateTimeZone::__construct(): Unknown or bad timezone () in DateTimeZone->__construct() (line 519 of /var/www/mysite/sites/all/modules/contrib/addtocal/addtocal.module).

Thank you.

πŸ› Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Saratt

Live updates comments and jobs are added and updated live.
  • Needs manual testing

    The change/bugfix cannot be fully demonstrated by automated testing, and thus requires manual testing in a variety of environments.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¨πŸ‡¦Canada dylan donkersgoed London, Ontario

    Here's another patch that includes RRULE in the ics file when it's available.

    I also noticed when testing this patch that there was a change to the behaviour of the addtocal_field_formatter_view() function that broke some functionality my site had that relied on it. I'm not sure it's actually incorrect though or if it's reasonable to treat this as a public API, so I've fixed it in my code rather than in the patch. Basically, in this check:

    if (strtotime($start_date) >= time() ||
              ($display['settings']['past_events'] == TRUE && strtotime($start_date) < time())) {
    

    due to changes in how the start date is loaded in earlier logic the start_date is now the very first date instead of the last date. This results in the addtocal link not being rendered in the element for nodes that have a first date before the current date, even if they have an upcoming recurring instance of the date. In my case this was being invoked by a custom block, but I suspect it might happen for the normal field formatter as well. I solved it by updating my field configuration to show the link on past events as well. But I wanted to flag it since it might cause issues for other sites.

  • πŸ‡¨πŸ‡¦Canada dylan donkersgoed London, Ontario

    Please disregard that last patch, I accidentally removed the URL: line from the ICS file. This one does not have that error. Interdiff is against patch 20 again.

Production build 0.71.5 2024