From 2baac3ae7c98ea13eb58022773349fe9f5a2b8cb Mon Sep 17 00:00:00 2001 From: larssandergreen Date: Sat, 29 Oct 2022 12:45:01 -0600 Subject: [PATCH] only show tag search option when there are tags on activities or cases --- CRM/Contact/Form/Search/Criteria.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CRM/Contact/Form/Search/Criteria.php b/CRM/Contact/Form/Search/Criteria.php index effcd31cc3..18fd41cd0d 100644 --- a/CRM/Contact/Form/Search/Criteria.php +++ b/CRM/Contact/Form/Search/Criteria.php @@ -77,9 +77,8 @@ class CRM_Contact_Form_Search_Criteria { foreach ($used_for as $key => $value) { //check tags for every type and find if there are any defined $tags = CRM_Core_BAO_Tag::getTagsUsedFor($key, FALSE, TRUE, NULL); - // check if there are tags other than contact type, if no - keep checkbox hidden on adv search - // we will hide searching contact by attachments tags until it will be implemented in core - if (count($tags) && $key != 'civicrm_file' && $key != 'civicrm_contact') { + // check if there are tags for cases or activities, if no - keep checkbox hidden on adv search + if (count($tags) && ($key == 'civicrm_case' || $key == 'civicrm_activity')) { //if tags exists then add type to display in adv search form help text $tagsTypes[] = $value; $showAllTagTypes = TRUE; -- 2.25.1