Use always-assigned isTagSet to determine if is tagset
authorEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 29 Nov 2021 01:42:40 +0000 (14:42 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Mon, 29 Nov 2021 01:46:38 +0000 (14:46 +1300)
CRM/Core/Form/Tag.php
templates/CRM/Activity/Form/Activity.tpl

index 36c0946bfb24e46866dadfcc4521a7e1d5df1a63..ef8c89df4e5039c4d6f6a5c4e084e8bda43525a8 100644 (file)
@@ -26,7 +26,7 @@ class CRM_Core_Form_Tag {
    *
    * @param CRM_Core_Form $form
    *   Form object.
-   * @param string $parentNames
+   * @param array $parentNames
    *   Parent name ( tag name).
    * @param string $entityTable
    *   Entitytable 'eg: civicrm_contact'.
@@ -43,7 +43,7 @@ class CRM_Core_Form_Tag {
     &$form, $parentNames, $entityTable, $entityId = NULL, $skipTagCreate = FALSE,
     $skipEntityAction = FALSE, $tagsetElementName = NULL) {
     $tagset = $form->_entityTagValues = [];
-    $form->assign("isTagset", FALSE);
+    $form->assign('isTagset', FALSE);
     $mode = NULL;
 
     foreach ($parentNames as &$parentNameItem) {
@@ -96,8 +96,8 @@ class CRM_Core_Form_Tag {
         $tagsetInfo[$mode] = [];
       }
       $tagsetInfo[$mode] = array_merge($tagsetInfo[$mode], $tagset);
-      $form->assign("tagsetInfo", $tagsetInfo);
-      $form->assign("isTagset", TRUE);
+      $form->assign('tagsetInfo', $tagsetInfo);
+      $form->assign('isTagset', TRUE);
     }
   }
 
index 6be2f9672c42b1f16ad9f249cab16cd4c49db52c..03071003ce9536c83953894e40175a2f1ea8b471 100644 (file)
   </tr>
   {/if}
 
-  {if !empty($tagsetInfo.activity)}
+  {if $isTagset}
     <tr class="crm-activity-form-block-tag_set">
       {include file="CRM/common/Tagset.tpl" tagsetType='activity' tableLayout=true}
     </tr>