summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-01-07 12:00:57 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-01-07 12:01:58 (GMT)
commitd0f570815dba494d22639ad67fdcd4c34cb9bf48 (patch)
tree8d235a819dcf7e7a8dd3e4098b089a581d61b67c
parent51281bc4a14064c6a48bca81a744b7d49c97e85e (diff)
downloadroundcubemail-plugins-kolab-d0f570815dba494d22639ad67fdcd4c34cb9bf48.tar.gz
Accept parent-relation from RELATED-TO property without RELTYPE parameter (#4158)roundcubemail-plugins-kolab-3.1.15
-rw-r--r--plugins/libcalendaring/libvcalendar.php3
-rw-r--r--plugins/libcalendaring/tests/libvcalendar.php1
-rw-r--r--plugins/libcalendaring/tests/resources/vtodo.ics2
3 files changed, 5 insertions, 1 deletions
diff --git a/plugins/libcalendaring/libvcalendar.php b/plugins/libcalendaring/libvcalendar.php
index 233213d..0d83ce3 100644
--- a/plugins/libcalendaring/libvcalendar.php
+++ b/plugins/libcalendaring/libvcalendar.php
@@ -453,7 +453,8 @@ class libvcalendar implements Iterator
break;
case 'RELATED-TO':
- if ($prop->offsetGet('RELTYPE') == 'PARENT') {
+ $reltype = $prop->offsetGet('RELTYPE');
+ if ($reltype == 'PARENT' || $reltype === null) {
$event['parent_id'] = $prop->value;
}
break;
diff --git a/plugins/libcalendaring/tests/libvcalendar.php b/plugins/libcalendaring/tests/libvcalendar.php
index 4ea9ede..7a54945 100644
--- a/plugins/libcalendaring/tests/libvcalendar.php
+++ b/plugins/libcalendaring/tests/libvcalendar.php
@@ -318,6 +318,7 @@ class libvcalendar_test extends PHPUnit_Framework_TestCase
$this->assertEquals('IN-PROCESS', $task['status'], "Task status property");
$this->assertEquals(1, count($task['x-custom']), "Custom properties");
$this->assertEquals(4, count($task['categories']));
+ $this->assertEquals('1234567890-12345678-PARENT', $task['parent_id'], "Parent Relation");
}
/**
diff --git a/plugins/libcalendaring/tests/resources/vtodo.ics b/plugins/libcalendaring/tests/resources/vtodo.ics
index 0d4534c..746787d 100644
--- a/plugins/libcalendaring/tests/resources/vtodo.ics
+++ b/plugins/libcalendaring/tests/resources/vtodo.ics
@@ -31,6 +31,8 @@ SEQUENCE:2
CATEGORIES:Tag1,Tag2
CATEGORIES:Tag3
CATEGORIES:Tag4
+RELATED-TO:1234567890-12345678-PARENT
+RELATED-TO;RELTYPE=CHILD:1234567890-12345678-CHILD
X-MOZ-GENERATION:1
BEGIN:VALARM
ACTION:DISPLAY