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

Zimbra ical import into Moodle fix

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 2.6.6
    • Fix Version/s: None
    • Component/s: Calendar
    • Labels:
      None
    • Affected Branches:
      MOODLE_26_STABLE

      Description

      Below is a solution/patch that will make it so Zimbra can synchronize ical with Moodle. The problem is that Moodle does not know how to handle Zimbra's quotes around the time zone id.
      DTSTART;TZID="America/Los_Angeles":20141119T093000

      The following fixes it.

      diff --git a/lib/bennu/iCalendar_parameters.php b/lib/bennu/iCalendar_parameters.php

      index d264083..af3f5ad 100644
      --- a/lib/bennu/iCalendar_parameters.php
      +++ b/lib/bennu/iCalendar_parameters.php
      @@ -178,7 +176,7 @@ class iCalendar_parameter {
                       if(empty($value)) {
                           return false;
                       }
      -                return (strcspn($value, '";:,') == strlen($value));
      +                return (strcspn($value, ';:,') == strlen($value));
                   break;
       
                   case 'VALUE':
      @@ -227,7 +225,7 @@ class iCalendar_parameter {
       
                   // Parameters we shouldn't be messing with
                   case 'TZID':
      -                return $value;
      +                return str_replace('"', '', $value);
                   break;
               }
           }
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              danmarsden Dan Marsden
              Reporter:
              dmonty Dean Montgomery
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: