public static function getContactTags($contactID, $count = FALSE) {
$contactTags = array();
if (!$count) {
- $select = "SELECT name ";
+ $select = "SELECT ct.id, ct.name ";
}
else {
$select = "SELECT count(*) as cnt";
}
while ($dao->fetch()) {
- $contactTags[] = $dao->name;
+ $contactTags[$dao->id] = $dao->name;
}
return $contactTags;
}
if (empty($tagIDs)) {
- return civicrm_api3_create_error('tag_id is a required field');
+ if ($op == 'remove') {
+ $tagIDs = array_keys(CRM_Core_BAO_EntityTag::getContactTags($entityIDs[0]));
+ }
+ else {
+ return civicrm_api3_create_error('tag_id is a required field');
+ }
}
$values = array('is_error' => 0);