- // Output tag list as nested hierarchy
- // TODO: This will only work when api.entity is "entity_tag". What about others?
- if (($fieldName == 'tag' || $fieldName == 'tag_id') && ($context == 'search' || $context == 'create')) {
- $options = CRM_Core_BAO_Tag::getTags('civicrm_contact', CRM_Core_DAO::$_nullArray, CRM_Utils_Array::value('parent_id', $params), '- ');
+ // Output tag list as nested hierarchy
+ // TODO: This will only work when api.entity is "entity_tag". What about others?
+ if ($context == 'search' || $context == 'create') {
+ return CRM_Core_BAO_Tag::getTags(CRM_Utils_Array::value('entity_table', $props, 'civicrm_contact'), CRM_Core_DAO::$_nullArray, CRM_Utils_Array::value('parent_id', $params), '- ');
+ }