diff --git a/src/Fields.php b/src/Fields.php index 9c4c23b1..14003f11 100644 --- a/src/Fields.php +++ b/src/Fields.php @@ -597,8 +597,9 @@ protected function wf_crm_get_fields($var = 'fields') { } } } + $tag_display_field = $this->utils->tag_display_field(); $all_tagsets = $this->utils->wf_crm_apivalues('tag', 'get', [ - 'return' => ['id', 'name', 'used_for'], + 'return' => ['id', $tag_display_field, 'used_for'], 'is_tagset' => 1, 'parent_id' => ['IS NULL' => 1], ]); @@ -607,7 +608,7 @@ protected function wf_crm_get_fields($var = 'fields') { $tagsets = ['' => t('Tag(s)')]; foreach ($all_tagsets as $set) { if (strpos($set['used_for'], $table_name) !== FALSE) { - $tagsets[$set['id']] = $set['name']; + $tagsets[$set['id']] = $set[$tag_display_field]; } } foreach ($tagsets as $pid => $name) { diff --git a/src/Utils.php b/src/Utils.php index 59efdd36..91f9da8a 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -1025,7 +1025,7 @@ public function hasMultipleValues($element) { /** * @return string Which field is the tag display field in this version of civi? */ - private function tag_display_field(): string { + public function tag_display_field(): string { if (version_compare(\CRM_Core_BAO_Domain::version(), '5.68.alpha1', '>=')) { return 'label'; }