Skip to content

Commit

Permalink
Fix regression when exporting single tags to iCalendar CATEGORIES.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Sep 21, 2017
1 parent c905b23 commit a9e207d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion kronolith/lib/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,11 @@ public function toiCalendar($calendar, $includeFiles = true)

// Tags
if ($this->tags) {
$vEvent->setAttribute('CATEGORIES', '', array(), true, $this->tags);
if (count($this->tags == 1)) {
$vEvent->setAttribute('CATEGORIES', $this->tags[0]);
} else {
$vEvent->setAttribute('CATEGORIES', '', array(), true, $this->tags);
}
}

// Location
Expand Down
6 changes: 5 additions & 1 deletion nag/lib/Task.php
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,11 @@ public function toiCalendar(Horde_Icalendar $calendar)
}

if ($this->tags) {
$vTodo->setAttribute('CATEGORIES', '', array(), true, $this->tags);
if (count($this->tags) == 1) {
$vTodo->setAttribute('CATEGORIES', $this->tags[0]);
} else {
$vTodo->setAttribute('CATEGORIES', '', array(), true, $this->tags);
}
}

/* Get the task's history. */
Expand Down
1 change: 1 addition & 0 deletions nag/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1873,6 +1873,7 @@
<date>2017-08-15</date>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [jan] Fix regression when exporting single tags to iCalendar CATEGORIES.
* [jan] Officially support PHP 7.
</notes>
</release>
Expand Down

0 comments on commit a9e207d

Please sign in to comment.