Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-49561

Error in iCalendar export of zero duration events from Moodle

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.7, 2.8.5, 2.8.8
    • Fix Version/s: 2.8.9, 2.9.3
    • Component/s: Calendar
    • Labels:
    • Testing Instructions:
      Hide
      Test 1
      1. Log in as an administrator.
      2. Click on the title of the calendar block.
      3. Create a new event without any duration.
      4. Export the calendar.
      5. The icalendar event should contain dates like the following (where YYYYMMDD is the start day and YYYYMMDD+1 is the day after - code section below)
      6. Export the event into a google calendar and ensure it works as expected.

      DTSTART;VALUE=DATE:YYYYMMDD
      DTEND;VALUE=DATE:YYYYMMDD+1
      

      Test 2
      1. Log in as an administrator.
      2. Click on the title of the calendar block.
      3. Create a new event with a duration.
      4. Export the calendar.
      5. The icalendar event should contain dates like the following (where YYYYMMDDTXXXXX is the start time - see code section below). The value after the T is the time in 24hr format.
      6. Export the event into a google calendar and ensure it works as expected.

      DTSTART:YYYYMMDDTXXXXX
      DTEND:YYYYMMDDTXXXXX
      

      Show
      Test 1 Log in as an administrator. Click on the title of the calendar block. Create a new event without any duration. Export the calendar. The icalendar event should contain dates like the following (where YYYYMMDD is the start day and YYYYMMDD+1 is the day after - code section below) Export the event into a google calendar and ensure it works as expected. DTSTART;VALUE=DATE:YYYYMMDD DTEND;VALUE=DATE:YYYYMMDD+1 Test 2 Log in as an administrator. Click on the title of the calendar block. Create a new event with a duration. Export the calendar. The icalendar event should contain dates like the following (where YYYYMMDDTXXXXX is the start time - see code section below). The value after the T is the time in 24hr format. Export the event into a google calendar and ensure it works as expected. DTSTART:YYYYMMDDTXXXXX DTEND:YYYYMMDDTXXXXX
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Fixed Branches:
      MOODLE_28_STABLE, MOODLE_29_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-49561_master

      Description

      When exporting a calendar from Moodle as ical, there is a problem with
      events with zero duration (called "without duration in Moodle)

      Currently this is exported with only a DTSTART, ex.:

      DTSTART:20150312T132500Z

      This causes different behaviour in eg. Google Calendar and Microsoft
      Outlook. Google sets the event to a 1 hour duration, Outlook more
      correcly issues an error.

      According to RFC2445 (see below) zero duration events should exported
      with VALUE=DATE in DTSTART, eg.:

      DTSTART;VALUE=DATE:20150312

      According to RFC2445 DTEND can then be omitted, but a large number of
      ical validators doesn't like that end it is OK to set it. So the above
      should be exported as:

      DTSTART;VALUE=DATE:20150312
      DTEND;VALUE=DATE:20150313

      The attached patch implements this.

      Ref. 4.6.1 in RFC2445:

      "...The "VEVENT" is also the calendar component used to specify an
      anniversary or daily reminder within a calendar. These events have a
      DATE value type for the "DTSTART" property instead of the default
      data type of DATE-TIME. If such a "VEVENT" has a "DTEND" property, it
      MUST be specified as a DATE value also. The anniversary type of
      "VEVENT" can span more than one date (i.e, "DTEND" property value is
      set to a calendar date after the "DTSTART" property value)...."

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              markn Mark Nelson
              Reporter:
              lsa-its Lars Anderson
              Peer reviewer:
              Mark Nelson
              Integrator:
              David Monllaó
              Tester:
              Ryan Wyllie
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                9/Nov/15