[REF][PHP8.2] Local variable for tagGroup
authorBradley Taylor <hello@brad-taylor.co.uk>
Thu, 21 Dec 2023 17:29:21 +0000 (17:29 +0000)
committerBradley Taylor <hello@brad-taylor.co.uk>
Thu, 21 Dec 2023 19:40:05 +0000 (19:40 +0000)
CRM/Contact/Form/Edit/TagsAndGroups.php

index fdc59e7b6e512c8fe59bf1e2ee81077960e64354..bb7da48e3b3111a5e9f6caecfa3ea72ae5bdbb97 100644 (file)
@@ -58,9 +58,7 @@ class CRM_Contact_Form_Edit_TagsAndGroups {
     $groupElementType = 'checkbox',
     $public = FALSE
   ) {
-    if (!isset($form->_tagGroup)) {
-      $form->_tagGroup = [];
-    }
+    $tagGroup = [];
     $form->addExpectedSmartyVariable('type');
     $form->addOptionalQuickFormElement('group');
     // NYSS 5670
@@ -109,7 +107,7 @@ class CRM_Contact_Form_Edit_TagsAndGroups {
             $groupsOptions[$key] = $group;
           }
           else {
-            $form->_tagGroup[$fName][$id]['description'] = $group['description'];
+            $tagGroup[$fName][$id]['description'] = $group['description'];
             $elements[] = &$form->addElement('advcheckbox', $id, NULL, $group['text'], $attributes);
           }
         }
@@ -143,7 +141,7 @@ class CRM_Contact_Form_Edit_TagsAndGroups {
       $parentNames = CRM_Core_BAO_Tag::getTagSet('civicrm_contact');
       CRM_Core_Form_Tag::buildQuickForm($form, $parentNames, 'civicrm_contact', $contactId, FALSE, TRUE);
     }
-    $form->assign('tagGroup', $form->_tagGroup);
+    $form->assign('tagGroup', $tagGroup);
   }
 
   /**