Skip to content

Commit

Permalink
Bug: 13393 Fix exporting Tags/Categories in vCard.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Jul 24, 2014
1 parent 15abd13 commit 0d7d325
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions turba/lib/Driver.php
Expand Up @@ -1130,6 +1130,10 @@ public function tovCard(Turba_Object $object, $version = '2.1',
$hooks = $injector->getInstance('Horde_Core_Hooks');
$decode_hook = $hooks->hookExists('decode_attribute', 'turba');

// Tags are stored externally to Turba, so they don't appear in the
// source map.
$attributes[] = '__tags';

foreach ($attributes as $key) {
$val = $object->getValue($key);
if ($skipEmpty && !is_array($val) && !strlen($val)) {
Expand Down Expand Up @@ -1651,9 +1655,9 @@ public function tovCard(Turba_Object $object, $version = '2.1',
}
$vcard->setAttribute('NOTE', $val, Horde_Mime::is8bit($val) ? $charset : array());
break;

case 'businessCategory':
case '__tags':
$val = explode(',', $val);
case 'businessCategory':
// No CATEGORIES in vCard 2.1
if ($version == '2.1' ||
($fields && !isset($fields['CATEGORIES']))) {
Expand Down

0 comments on commit 0d7d325

Please sign in to comment.